如何在Python中使用请求替换selenium?

时间:2018-03-09 07:21:09

标签: python selenium python-requests

我使用Selenium使用以下代码获取结果。

import requests
import selenium
import time


driver.get(r'http://www.example.com')
a = driver.find_element_by_xpath("//input[@type='file']")
a.send_keys(r'C:\mypic.jpg')
time.sleep(5)
driver.find_element_by_xpath("//result[@output='data']").click()
c =  driver.find_element_by_xpath("//category[@id='front']").text

如何使用requests来获得结果?

谢谢。

0 个答案:

没有答案