在用Python请求刮擦时,如何避免这种付费墙?
我正在尝试从具有付费墙的网站下载内容。 您有许多免费文章可以阅读,然后需要订阅才能阅读更多文章。 但是,如果您以隐身模式打开链接,则可以为打开的每个隐身窗口阅读另一篇文章。
因此,我正在尝试使用Python的请求库从本网站下载一些页面。 我请求URL,然后使用BS4解析结果。但是,它仅适用于列表中的第一页,以下内容没有内容,而是带有“购买订阅等”的消息。
如何避免这种情况?
I am trying to download content from a website which has a sort of paywall.
You have a number of free articles you can read and then it requires a subscription for you to read more.
However, if you open the link in incognito mode, you can read one more article for each incognito window you open.
So I am trying to download some pages from this site using Python's requests library.
I request the URL and then parse the result using Bs4. However it only works for the first page in the list, the following ones don't have content but have instead the message with "buy a subscription etc.".
How to avoid this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以尝试在浏览器中关闭JavaScript,它可能会起作用,但不能100%。
I think you can try to turn off javascript in the browser, it may work, but not 100%.