解析HTML无限滚动 [英] Parse HTML Infinite Scroll

查看:96
本文介绍了解析HTML无限滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过无限滚动来解析页面的HTML.我想加载所有内容,以便我可以解析所有内容.我正在使用Python.有提示吗?

I'm trying to parse the HTML of a page with infinite scrolling. I want to load all of the content so that I can parse it all. I'm using Python. Any hints?

推荐答案

这些页面使用AJAX更新其html.通常,您只需要查找浏览器发送的新AJAX请求,猜测AJAX网址参数的含义并从API中获取数据即可.

Those pages update their html with AJAX. Usually you just need to find the new AJAX requests send by browser, guess the meaning of the AJAX url parameters and fetch the data from the API.

API服务器可以验证AJAX请求的用户代理,引荐来源网址,cookie,oauth_token ...,请密切注意它们.

API servers may validate the user agent, referer, cookie, oauth_token ... of the AJAX request, keep an eye on them.

这篇关于解析HTML无限滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆