0

So i have a simple loop as follows

while True:
    score_driver2 = webdriver.Chrome(options = chrome_options)
    score_driver = score_driver2.get("https://dtlive.com.au/afl/dataview.php")
    time.sleep(2)
    score_driver2.quit()
    time.sleep(30)

which essentially access the above website every 30 seconds and stores its data elsewhere. This loop constantly runs in the background whilst other functions use the data in "score_driver".

Problem is, as soon as it runs, the classic page crash from tab crash error occurs. I've read many questions on this site with similar problems, which seemed to be solved with

chrome_options = Options()
chrome_options.add_argument('--no-sandbox')

but that hasn't worked in my case. The options are the first thing run after importing packages.

Any pointers to how I can fix this would be appreciated, i'm completely stumped.

broccoli
  • 25
  • 6
  • _I've read many questions on this site with similar problems_: Which posts/discussions? – undetected Selenium Jun 09 '22 at 14:38
  • https://stackoverflow.com/questions/53902507/unknown-error-session-deleted-because-of-page-crash-from-unknown-error-cannot https://stackoverflow.com/questions/70899797/page-is-crashing-from-tab-crash-when-calling-multiple-apis-selenium-with-flask and then other websites – broccoli Jun 09 '22 at 14:49
  • Is that you're trying to `.quit()` the driver while it's busy? - you launch it and give it 2 seconds to complete all calls before you're trying to terminate it. When I go to your URL it took `3.60 seconds` - and as you're creating a new browser & profile each time you don't have cached data . – RichEdwards Jun 09 '22 at 16:08
  • A get() method returns void... not sure why try to assign score_driver to a void there... seems like it'd be null. We'd need to see more code to understand why the page crash is happening. Might have something to do with your options object.. or your other tasks... – pcalkins Jun 09 '22 at 21:31

0 Answers0