当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Generate various events in 'Web scraping with beautiful soup'

问题描述:

Is there any way to generate various events like:

  • filling an input field
  • submitting a form
  • clicking a link
  • Handling redirection etc

via python beautiful soup library. If not what's the best way to do above (basic functionality).

网友答案:

BeautifulSoup is a tool for parsing and analyzing HTML. It cannot talk to web servers, so you'd need another library to do that, like urllib2 (builtin, but low-level) or requests (high-level, handles cookies, redirection, https etc. out of the box). Alternatively, you can look at mechanize or windmill, or if you also require JavaScript code to be executed, phantomjs.

分享给朋友:
您可能感兴趣的文章:
随机阅读: