4

Hi I am trying to run the automated search and get results from a web database, i have the following codes:

chrome_options = webdriver.ChromeOptions() 
chrome_options.add_argument("--disable-popup-blocking")
driver = webdriver.Chrome(options=chrome_options) 

driver.get('http://www.ddfint.net/search.cfm/')
search_form=driver.find_element_by_name('compoundName')
search_form.send_keys('Acetylcarnitine')
search_form.submit()

It returns a not found result, I noticed that the web page has a alert: not secured, where the 'popups-redirect' was blocked, once I manually removed the block, I was able to get the result manually. What should I change in the code to make it work? The options I added does not change the default setting from 'blocking' to 'allow', thank you!

I have tried chrome_options.add_argument("--allow-insecure-localhost") and this did not resolve my issue either.

Sers
  • 12,047
  • 2
  • 12
  • 31
m4gg
  • 73
  • 1
  • 6

2 Answers2

1

You could try adding a ChromeOption that ignores the SSL error:

chrome_options.add_argument("--allow-insecure-localhost")
CEH
  • 5,701
  • 2
  • 16
  • 40
  • Thank you Christine, Just tried, still does not work. – m4gg Oct 01 '19 at 19:18
  • I don't know if I am able to reproduce the original problem. I've copied your code into my IDE and it is running without issues. – CEH Oct 01 '19 at 19:33
  • I have tried from yesterday, just did not work. seems to me, the chrome pop-up redirects were blocked, everytime I run, I got the not found result, and the pop-ups-redirects setting back to blocked. – m4gg Oct 01 '19 at 19:37
  • I am using Mac, do you think this may be the problem? Thanks for helping. – m4gg Oct 01 '19 at 19:38
  • I am running on windows, so it's possible Mac may be changing things. I did see the 'not found' error the first time I ran, but when I ran a 2nd time, the error disappeared and I stopped seeing it when I ran multiple times after that. so it's difficult to reproduce. – CEH Oct 01 '19 at 19:39
  • @yangm you could also try adding a few more chrome options. here's a standard set I use: `--disable-extensions`, `--no-sandbox`, and `disable-infobars` – CEH Oct 01 '19 at 19:40
  • Tried your standard set, still not working. Still have the pop-ups-redirects blocked. :( – m4gg Oct 01 '19 at 19:51
  • @yangm This discussion may help you -- someone had to change their browser settings using webdriver. https://stackoverflow.com/questions/7742852/popup-blocking-in-google-chrome-causing-issues-with-capybara-rspec-tests – CEH Oct 01 '19 at 19:58
  • greatly appreciate your help, I will try later after class. thanks again. – m4gg Oct 01 '19 at 20:13
1

Remove trailing slash from the url. You should use http://www.ddfint.net/search.cfm

You can read about here.

Sers
  • 12,047
  • 2
  • 12
  • 31