1

OS:- Kali linux 2019.1 Firefox 60.6.1 Geckodriver :- 0.18.0 selenium 3.5.2

The code gets stuck after the browser.get line. When I check the geckodriver logs..it shows > ddons.productaddons WARN Failed downloading via XHR, status: 0, reason: error (Don't Know if it is relevant)

I tried changing the " to ' for the URL, Tried changing browser.get to browser.navigate.to with no success. The URL works fine. I can open it in firefox browser. It also doesn't take a lot of time to open. So, doesn't seem to be a wait() issue.

# ------------[STARTS A WEBSERVER + FORWARDS PORT WITH NGROK]------------- #

os.system('xterm -e "cd ./WEBSERVER/ && php -S 127.0.0.1:80" &')
os.system("./ngrok http 80 > /dev/null &")




time.sleep(3)
display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox(firefox_binary=binary,executable_path='base/geckodriver')
browser.get("http://localhost:4040/status")
time.sleep(5)
url_f=str(browser.find_element_by_css_selector("li.list-unstyled:nth-child(1) > div:nth-child(2) > table:nth-child(2) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2)").text)
browser.close()
show_url = str(url_f)


# `GENERATES EMAIL TEMPLATE


emaildata = str(EMAIL1_TW)
emaildata = emaildata.replace('_EF', str(UNAME))
emaildata = emaildata.replace('G_URL', str(n_url))
emaildata = emaildata.replace('Windows 7', str(Email_OS))
emaildata = emaildata.replace('Antartica', str(Email_from))


# `DECIDES THE EMAIL ADDRESS

from_email = str(random.choice(['JohnSpencer@Kolear.com','no-reply@kolear.com']))



##################################
#      SENDS  EMAIL       #
##################################


subprocess.call(['sendemail', '-f', from_email,'-t', str(Email), '-u', 'Notice for you', '-m', emaildata, '-s', smtps+":"+port, '-o', 'tls=no','-xu', username, '-xp', password])
os.system('reset')
user240163
  • 19
  • 8
  • Update the question with the error stack trace – undetected Selenium Apr 08 '19 at 11:27
  • If you navigating to a URL, why are you using `get`? it should be `go(url)` instead. – Shivam Pandey Apr 08 '19 at 11:28
  • This code is within a python code. I don't know how to run a stack trace in this case. – user240163 Apr 08 '19 at 12:13
  • Please read https://stackoverflow.com/help/how-to-ask on how to ask a question. This is missing too much information, the question is somewhat ambiquitious, and the formatting needs revision – Alexander Falk Apr 08 '19 at 12:15
  • @AlexanderFalk added the OS version, firefox version, selenium version, geckodriver version...If you are referring to a stack trace..I mentioned ..this is within a python code..I don't know how to run stack in this case. – user240163 Apr 08 '19 at 12:18
  • @ShivamPandey can't find any such command. – user240163 Apr 08 '19 at 12:18
  • @DebanjanB How to run it ..if this code is within a python code? – user240163 Apr 08 '19 at 12:19
  • Why is python code tagged with Java, @user240163? Seems to me this has nothing to do with Java? Or are you running a script embedded from Java? In that case? Why? – Alexander Falk Apr 08 '19 at 12:20
  • **error stack trace** -> the error trace logs that appear within the console – undetected Selenium Apr 08 '19 at 12:21
  • @AlexanderFalk Thank you for your patience. I have updated the code for the bigger picture. If this question has wrong attributions, I will delete it and post it in Python..I don't think though..this is a python issue. I searched many questions with the same issue..they were all related to either the Java code or the selenium/firefox versions. – user240163 Apr 08 '19 at 12:36
  • @DebanjanB No errors appear in the console. I am debugging this with pdb. It does nothing after the browser.get line. So maybe it is not an issue with Java code but similar questions had solutions with the code and sometimes with selenium/firefox version specific code changes. I wasn't sure so I tagged it in Java as well. – user240163 Apr 08 '19 at 12:40
  • @DebanjanB So, Gecko is 0.18.0 which is compatible with selenium 3.5(>3.4) which is compatible with firefox 60.6.1(52-62)...?? – user240163 Apr 08 '19 at 13:32

1 Answers1

1

The error trace logs would have helped us to debug the issue in a better way. However your main issue is the incompatibility between the version of the binaries which you are using:

  • Firefox v60.6.1
  • Geckodriver v0.18.0
  • Selenium v3.5.2

If you are using GeckoDriver-Selenium-Firefox combo, you need to follow the following compatibility chart:

supported_platforms_geckodriver_24

You can find a detailed discussion in Which Firefox browser versions supported for given Geckodriver version?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • So, Gecko is 0.18.0 which is compatible with selenium 3.5(>3.4) which is compatible with firefox 60.6.1(52-62)...?? – user240163 Apr 08 '19 at 13:18