Python3 implements WeChat crawlers and python3 email Crawlers

Source: Internet
Author: User

Python3 simple crawler and python3 email Crawler

Use ghost. py to search for information about a public account.

#-*-Coding: UTF-8-*-import sysreload (sys) import datetimeimport timesys. setdefaultencoding ("UTF-8") from ghost import Ghostghost = Ghost (wait_timeout = 20) url = "http://weixin.sogou.com/gzh? Openid = oIWsFt8JDv7xubXz5E3U41T0eFbk "page, resources = ghost. open (url) result, resources = ghost. wait_for_selector ("# wxmore a") from bs4 import BeautifulSoupc = 0 while True: if c> = 30: break soup = BeautifulSoup (ghost. content) for wx in soup. find_all ("h4"): print wx page, resources = ghost. evaluate ("" var div1 = document. getElementById ("wxbox"); div1.innerHTML = '';" ") ghost. click ("# wxmore a") result, resources = ghost. wait_for_selector (". wx-rb3 ") c = c + 1 pass

The above is all the content of this article. I hope it will help you learn Python.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.