neelsomani / senator-filings

Scrape public filings of the buy + sell orders of U.S. senators and calculate their returns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing to Scrape Senators

mcrowson opened this issue · comments

Trying to run the main.py file and getting the following:

Traceback (most recent call last):
  File "main.py", line 182, in <module>
    senator_txs = main()
  File "main.py", line 156, in main
    set_search_results_layout(driver)
  File "main.py", line 85, in set_search_results_layout
    header = c.get_attribute(INNER_TEXT)
  File "/home/matthew/Documents/senator-filings/env/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 139, in get_attribute
    attributeValue = self.parent.execute_script(
  File "/home/matthew/Documents/senator-filings/env/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 634, in execute_script
    return self.execute(command, {
  File "/home/matthew/Documents/senator-filings/env/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/home/matthew/Documents/senator-filings/env/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 241, in check_response
    raise exception_class(message, screen, stacktrace, alert_text)
selenium.common.exceptions.UnexpectedAlertPresentException: Alert Text: DataTables warning: table id=filedReports - Ajax error. For more information about this error, please see http://datatables.net/tn/7
Message: unexpected alert open: {Alert text : DataTables warning: table id=filedReports - Ajax error. For more information about this error, please see http://datatables.net/tn/7}
  (Session info: chrome=81.0.4044.138)

Running latest Chromium (rather than the supplied chromedriver) on Arch Linux

Hmm, were you able to reproduce the error? Looks like there is some sort of AJAX failure and an alert is popping up for you.

Hi @mcrowson, let me know if you're still having issues. I'll close this issue in the meantime but feel free to open again.

Feel free to close. Haven’t had a chance to dig deeper. If others can do it, it is likely that I got a random pop up or just having a different browser was the issue.