view raw
UnityNewb UnityNewb - 8 months ago 50
Python Question

Selenium Python Webdriver chrome print src's of all imgs

I want to print all src of imgs in the page, i want to see if it recognize it,
cuz when i do


its says:

C:\Users\Bar\AppData\Local\Programs\Python\Python35-32\python.exe C:/Users/Bar/PycharmProjects/yad2/
Traceback (most recent call last):
File "C:/Users/Bar/PycharmProjects/yad2/", line 14, in <module>
File "C:\Users\Bar\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\", line 293, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\Bar\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\", line 752, in find_element
'value': value})['value']
File "C:\Users\Bar\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\", line 236, in execute
File "C:\Users\Bar\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //img[@src='' because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//img[@src=''' is not a valid XPath expression.
(Session info: chrome=52.0.2743.116)
(Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.1.7601 SP1 x86_64)

I have tried with
, didn't work , so I want to print all of the srcs of the
, how can I do that?


Ok propably @Saurabh Gaur were right there is Iframe in the site , Simple solution ,


Thats it from there i could find the button , then i comeback


and from here i can continue to the next Frame Thats it! @Saurabh Gaur Thank you So much! , you were Excellent!