📅  最后修改于: 2023-12-03 15:21:07.399000             🧑  作者: Mango
Webdriver Antibot is a Python package used for bypassing anti-bot measures on websites that use Selenium WebDriver detection.
To install, simply use pip:
pip install webdriver-antibot
from webdriver_antibot import WebDriverAntiBot
# Create an instance of WebDriverAntiBot
driver = WebDriverAntiBot()
# Navigate to a website
driver.get('https://www.example.com/')
# Do whatever you need to do on the website
# ...
# Close the driver when you're done
driver.quit()
from webdriver_antibot import WebDriverAntiBot
from webdriver_antibot.utils import generate_user_agent
# Generate a random user-agent
user_agent = generate_user_agent()
# Create an instance of WebDriverAntiBot with custom user-agent and viewport size
# You can also pass in custom Chrome options or Firefox profile preferences here
driver = WebDriverAntiBot(
options={"user_agent": user_agent, "viewport_size": (1366, 768)}
)
# Navigate to a website
driver.get('https://www.example.com/')
# Do whatever you need to do on the website
# ...
# Close the driver when you're done
driver.quit()
If you find a bug or have a suggestion, feel free to open an issue or pull request on GitHub.
Webdriver Antibot is released under the MIT License.