2
我試圖導航到一個頁面使用硒在python與發佈請求。Selenium Web驅動程序導航到帶POST請求的頁面
我有與seleniumrequests
工作要求:
response = driver.request('POST','http://example.com', data={"agree": "1"})
但它只返回一個200請求字符串,我想實際上導航到該頁面。
我試圖導航到一個頁面使用硒在python與發佈請求。Selenium Web驅動程序導航到帶POST請求的頁面
我有與seleniumrequests
工作要求:
response = driver.request('POST','http://example.com', data={"agree": "1"})
但它只返回一個200請求字符串,我想實際上導航到該頁面。
它可能有點慢,但是你不能讓你的驅動程序找到該元素(複選框或任何它你必須點擊說你同意),並讓它點擊它,然後點擊同意按鈕來提交它?
所以使用這樣的:
self.driver = webdriver.Firefox()
driver = self.driver
driver.get('http://example.com')
driver.findElementById('idOfCheckBox').click()
然後如果有另一個按鈕,提交使用另一個driver.findElementById('idOfButton').click()
聽起來像是你需要瀏覽網站之前那種同意免責聲明或使用條款, 對? – alecxe
@alecxe是的沒錯,任何想法如何提交? – Crizly
我想你可能會以不同的方式處理它。你能提供網址到實際的網站嗎?謝謝。 – alecxe