我想从http://www.sse.com.cn/assortment/stock/list/info/announcement/index.shtml
那里获取数据
我尝试使用requests
import requests
url = r'http://www.sse.com.cn/assortment/stock/list/info/announcement/index.shtml'
payload = {'inputCode': '600000', 'single_select_2':'DQGG', 'start_date': '2018-06-01', 'end_date':'2019-01-23'}
response = requests.post(url, data = payload)
但是,我无法获得正确的结果。
正确的方法是什么?
如何使用pyqt5
来做到这一点?
答案 0 :(得分:0)
您需要使用Python Selenium来实现。不管您是否知道所需的数据,Post API都是不公开的,因此开发人员无法使用它。
尝试使用Selenium,它对于Web抓取和Web自动化非常容易。这是一些启蒙命令/功能。
driver.get(web_url)
driver.find_element_by_xpath(xpath).click()
driver.find_element_by_xpath(xpath).send_keys('asd')