Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我可以找到XPATH_Python_Selenium - Fatal编程技术网

Python 我可以找到XPATH

Python 我可以找到XPATH,python,selenium,Python,Selenium,我可以找到我想要的元素的XPATH,但是它不允许我单击 <a href="/traderoom" target="_self" class="Button Button_orange Button_big Button_bold css-u4v0q0 e1y8wypm7"><span>ทำการซื้อขายได้ </span></a> enter driver.find_eleme

我可以找到我想要的元素的XPATH,但是它不允许我单击

<a href="/traderoom" target="_self" class="Button Button_orange Button_big Button_bold css-u4v0q0 e1y8wypm7"><span>ทำการซื้อขายได้ </span></a>
enter driver.find_element_by_xpath('a[1][@href='/traderoom']').click() here

xpath-.//a[contains@class,“Button_orange”]

应该抓住第一个标签并单击它

driver.find_elements_by_css_selector("a[@href='/traderoom']")[1].click() 

请提供您正在尝试刮取的网站的链接。另外,您是否尝试过其他方法,如通过css选择器查找元素?