[英]How to get request headers in python scrapy
How to get request headers in python scrapy for a dynamic table data?如何在 python scrapy 中获取动态表数据的请求标头?
The request is made when a button is clicked.单击按钮时发出请求。
Is there is a way to get the data without using click simulation?有没有办法在不使用点击模拟的情况下获取数据?
You can extract the request from the website using the browser network tab.您可以使用浏览器网络选项卡从网站提取请求。 Observe the network tab to check which request is made when the button is clicked.
观察网络选项卡以检查单击按钮时发出的请求。
After that you can make the same request to the API in scrapy using the Request
class.之后,您可以使用
Request
class 向 scrapy 中的 API 发出相同的请求。
Something like this:像这样的东西:
yield scrapy.Request("http://www.example.com/some_page.html",
headers={'header', 'value'},
callback=self.parse_table
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.