【发布时间】:2017-09-17 19:17:23
【问题描述】:
我对 selenium 很陌生,我正在尝试弄清楚如何模拟 onclick
这是我在检查 html 源代码时在源代码中看到的内容
<a href="#" onclick="document.getElementById('pN').selectedIndex = 0;document.getElementById('optionList').submit();return false"> <img src="images/ListingOptionSearch.jpg" onmouseover="this.src='images/ListingOptionSearchHover.jpg'" onmouseout="this.src='images/ListingOptionSearch.jpg'"> </a>
我试过了:
driver.find_element_by_css_selector("a[onlick*=document.getElementById('pN')
.selectedIndex]").click()
但我收到了InvalidSelectorException
有什么想法吗?
谢谢!
【问题讨论】:
标签: python selenium selenium-webdriver web-scraping