An SDK for artificial-human interaction with websites, namely Google search and CAPTCHAs. One need not pursue full humanness to achieve adequate emulation thereof, rather merely some kind of humanoidness, whence the packages name.
OTHER License
pip install git+https://github.com/ArtificialHumanoid/Humanoid#subdirectory=build
.
Issues and, of course, pull requests, are tracked via GitHub. Accordingly, all commit messages should be prefixed with “#” (followed by an issue or pull request numbered reference).
googlesearch
googlesearch is a Python library for searching Google, easily. googlesearch uses requests and BeautifulSoup4 to scrape Google.
To get results for a search term, simply use the search function in googlesearch. For example, to get results for "Google" in Google, just run the following program:
googlesearch.search("Google")
By default, googlesearch
returns 10 results.
To get a 100 results on Google, for example:
googlesearch.search("Google", num_results=100)
In addition, you can change the language Google searches in. For example, to get results in French run the following program:
googlesearch.search("Google", lang="fr")
To extract more information, such as the description or the result URL, use an advanced search:
googlesearch.search("Google", advanced=True)
which returns List[SearchResult]
with each result having the properties
If requesting more than 100 results, googlesearch will send multiple requests to go through the pages. To increase the time between these requests, use sleep_interval:
googlesearch.search("Google", sleep_interval=5, num_results=200)
captcha_solver
Univeral API to work with captcha solving services.
Service website is https://2captcha.com
from captcha_solver import CaptchaSolver
solver = CaptchaSolver('twocaptcha', api_key='2captcha.com API HERE')
raw_data = open('captcha.png', 'rb').read()
print(solver.solve_captcha(raw_data))
Service website is https://rucaptcha.com
from captcha_solver import CaptchaSolver
solver = CaptchaSolver('rucaptcha', api_key='RUCAPTCHA_KEY')
raw_data = open('captcha.png', 'rb').read()
print(solver.solve_captcha(raw_data))
from captcha_solver import CaptchaSolver
solver = CaptchaSolver('browser')
raw_data = open('captcha.png', 'rb').read()
print(solver.solve_captcha(raw_data))
Service website is http://getcaptchasolution.com
from captcha_solver import CaptchaSolver
solver = CaptchaSolver('antigate', api_key='ANTIGATE_KEY')
raw_data = open('captcha.png', 'rb').read()
print(solver.solve_captcha(raw_data))