且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python:Beautifulsoup 返回 None 或 []

更新时间:2023-11-30 14:43:28

网络正在发展,因为它变得越来越难以理解.在大多数情况下,现代"网页不再由服务器生成,因为用户会看到它们;相反,大量的脚本被发送给用户,并且基本上将任何东西注入到 DOM 中.

The web is devolving in that it's becoming increasingly inscrutable. "Modern" webpages, for the most part, are no longer generated by the server as the user will see them; rather, globs of script are being sent to the user and basically injecting whatever ¯\_(ツ)_/¯ into the DOM.

这就是为什么你需要在成熟的浏览器中使用 Selenium 绑定,正如上面 QHarr 所提到的.

That's why you'll need to use Selenium bindings with a full-blown browser, as mentioned by QHarr above.

我很抱歉没有将其作为评论,但显然我需要 50 分才能做到这一点.

My apologies for not making this a comment, but apparently I need 50 points to do that.