trying to click a html button with selenium with python

Trying to go trough a website using selenium to parse some stuff, but i cant click it on a button to load a pop up java script page using firefox + geckowebdriver (latest) view_larger_image_button = driver.find_element_by_xpath(‘//span[text()="View larger image"]’) driver.click(view_larger_image_button) Here is the button : <div class="main-link" data-spm-anchor-id="a2700.details.0.i4.2b7b5fc5f54UAP"><i class="detail-next-icon detail-next-icon-search detail-next-small"></i><span>View larger image</span></div> i get the… Read More trying to click a html button with selenium with python

Python Selenium 'WebDriver' object has no attribute 'switch_to_window'

My Code do what it should do until it reach the point when a button is clicked and a second PDF window opens. I try to switch to the PDF window to close it but it does not work, my Code after the button is clicked looks like: while len(browser.window_handles) < 2: sleep(1) browser.switch_to_window(browser.window_handles[1]) sleep(0.5)… Read More Python Selenium 'WebDriver' object has no attribute 'switch_to_window'

Python Selenium, Error with find_element_by() command

I don’t know the reason for this error, for some reason the find_element_by_() commands are not being recognized, I’ve already tried to reinstall everything, I changed the Python version, nothing works, does anyone know how to solve this problem? >Solution : find_element_by_* methods are now deprecated. find_element(By. are used now. So, instead of find_element_by_name it… Read More Python Selenium, Error with find_element_by() command