Mechanize and BeautifulSoup for PHP? [closed]

╄→гoц情女王★ 提交于 2019-12-29 14:21:53

问题


I was wondering if there was anything similar like Mechanize or BeautifulSoup for PHP?


回答1:


SimpleTest provides you with similar functionality:

http://www.simpletest.org/en/browser_documentation.html




回答2:


I don't know how powerful BeautifulSoup is, so maybe this won't be as great ; but you could try using DOMDocument::loadHTML :

The function parses the HTML contained in the string source . Unlike loading XML, HTML does not have to be well-formed to load.

After using this, you should be able to access the HTML document using DOM methods -- including XPath queries.



来源:https://stackoverflow.com/questions/1263800/mechanize-and-beautifulsoup-for-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!