2017-03-07 36 views
0

的HTML是如下: enter image description here如何使用硒點擊「結帳」按鈕?

我曾嘗試多種方法,如driver.find_element_by_css_selector等。無worked.please幫助

+2

詳情請;你使用的是什麼確切的代碼,哪個驅動程序。看到什麼錯誤? – pbuck

+1

目前,沒有足夠的信息來提供任何幫助。請[在問題中加入'html',因爲圖像鏈接過時,並且圖像共享網站被某些用戶阻止](http://stackoverflow.com/help/how-to-ask)。另外,你嘗試過哪些選擇器?當你說「沒有工作」時,這意味着什麼,你是否得到例外?什麼都沒有發生? – mrfreester

+0

所以我在python上使用chromedriver。我試圖實現此網站上的自動結帳功能:http://www.supremenewyork.com/shop/shirts/z4fqw32ih/n7g4xp63n 而問題是我一直在嘗試使用'find_element_by_css_selector'和'find_element_by_xpath'和沒有工作或可能是因爲我不知道如何使用這些,因爲我不熟悉HTML表單。有什麼我該做的? –

回答

0

不知道更多的信息,嘗試使用XPath和.click()

driver.find_element_by_xpath('//a[@class="button checkout"]').click()