[百度/维基百科爬虫]给定一个词条,去百度和维基百科中直接查找 #爬虫
✓ Published0🌍 Public
SShawn91
Last edited Jan 25, 2019
Created on Jan 9, 2019
This example demonstrates a Python web crawler that queries Baidu Baike and Chinese Wikipedia for a given search term, falling back to Google Search and the English Wikipedia to locate a corresponding Chinese article. The script uses `requests` with custom user-agent headers and proxy settings, and `BeautifulSoup` (`bs`) to parse HTML. It fetches Baidu pages directly when available, and for Wikipedia, it locates the English entry via Google, extracts the Chinese interlanguage link, and retrieves that page. The visualization shows the logic and branching of these HTTP requests.
AI-generated description