mydriver = webdriver.Firefox()
mydriver.get(baseurl)
mydriver.find_element_by_xpath(xpaths['searchboxTxtBox']).clear()
mydriver.find_element_by_xpath(xpaths['searchboxTxtBox']).send_keys(searchbox)
mydriver.find_element_by_xpath(xpaths['submitButton']).click()
data = mydriver.find_elements_by_xpath('*//div[@class="product-result clearfix"]//h3//a//@href')
for element in data:
print element.get_attribute("innerHTML")
在执行上面的代码时,它会抛出错误:
the given selector is either invalid or does not result in a Web Element.
我需要抓一些url的帮助