Skip to main content

又一个爬虫新轮子~

Project description

WebHelper

Web 爬虫小工具

安装

pip install web-helper

使用方法

from web_helper import *

title = get_html(f'https://baidu.com', obey_robot=False).to_soup().find('title').text
assert title == '百度一下,你就知道'

使用代理

from web_helper import *

set_global_random_proxy('ws_token')  # 设置全局代理,TOKEN 前往: https://proxy.webshare.io/subscription/ 获取
title = get_html(f'https://baidu.com', obey_robot=False).to_soup().find('title').text
assert title == '百度一下,你就知道'

设置日志级别

from web_helper import *
import sys

logger.remove()
logger.add(sys.stdout, level="TRACE")

title = get_html(f'https://baidu.com', obey_robot=False).to_soup().find('title').text
assert title == '百度一下,你就知道'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web_helper-0.1.7.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

web_helper-0.1.7-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page