Browsing context has been discarded

See original GitHub issue

I tried to run it and received: selenium.common.exceptions.NoSuchWindowException: Message: Browsing context has been discarded

~/UdemyCourseGrabber# python3 main.py
Paste in your Udemy course URL: https://www.udemy.com/course/modern-javascript-from-novice-to-ninja/
Traceback (most recent call last):
  File "main.py", line 13, in <module>
    course_info = get_info(udemy_url)
  File "/root/UdemyCourseGrabber/functions.py", line 248, in get_info
    course_name = get_course_name(udemy_url)
  File "/root/UdemyCourseGrabber/functions.py", line 15, in get_course_name
    browser.find_element_by_css_selector(".btn-primary > span:nth-child(1)")
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 598, in find_element_by_css_selector
    return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
    'value': value})['value']
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: Browsing context has been discarded

Great work, please keep it up. Thank you.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
keetheshcommented, Jan 10, 2020

Sorry for the late response! I don’t actually know why this is happening, but I’ll rewrite the program (once again) so that it uses Scrapy. It should be working then.

1reaction
keetheshcommented, Jan 5, 2020

I changed some things. Could you please try git pulling and retrying?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browsing context has been discarded using GeckoDriver ...
This error message... Browsing context has been discarded . Failed to decode response from marionette ...implies that the communication ...
Read more >
Browsing context has been discarded after "WebDriver ...
When running the following test with geckodriver it fails with the "error":"no such window","message":"Browsing context has been discarded" message:
Read more >
Browsing context has been discarded // running multiple ...
I'm building an app that sequentially launches multiple headless Firefox clients. Code executed. int i = 0; while (i < 80) { try...
Read more >
Message: Browsing context has been discarded
I am running following commands: from selenium import webdriver from selenium.webdriver.firefox.options import Options options = Options()
Read more >
5 Loading Web pages — HTML5 - W3C
When a browsing context is discarded , the strong reference from the user agent itself to the browsing context must be severed, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found