https://github.com/wwwwwydev/crawlipt
The script for selenium in python. Make automated testing easier! 使用json脚本驱动selenium
https://github.com/wwwwwydev/crawlipt
crawling-python crawlipt reptile selenium selenium-python test-automation testing-tools
Last synced: 16 days ago
JSON representation
The script for selenium in python. Make automated testing easier! 使用json脚本驱动selenium
- Host: GitHub
- URL: https://github.com/wwwwwydev/crawlipt
- Owner: WwwwwyDev
- License: mit
- Created: 2024-04-19T05:48:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-06T09:47:45.000Z (11 months ago)
- Last Synced: 2025-03-31T10:08:33.871Z (23 days ago)
- Topics: crawling-python, crawlipt, reptile, selenium, selenium-python, test-automation, testing-tools
- Language: Python
- Homepage: https://wwydev.gitbook.io/crawlipt
- Size: 343 KB
- Stars: 164
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## introduction
You can use crawlipt to driver the selenium by script in python.The script adopts JSON format for better cross language operations and physical storage.
## installing
You can use pip or pip3 to install the crawlipt`pip install crawlipt` or `pip3 install crawlipt`
If you have already installed crawlipt, you may need to update to the latest version
`pip install --upgrade crawlipt`
## quickly start
```python
from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver as wd
from selenium.webdriver.chrome.service import Service
import crawlipt as cpt
option = wd.ChromeOptions()
option.add_argument("start-maximized")
option.add_argument("window-size=1920x3000")
agent = 'user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"'
option.add_argument(agent)
webdriver = wd.Chrome(service=Service(ChromeDriverManager().install()), options=option)# Define scripts
# You can also deserialize JSON strings into a dictionary
script = {
"method": "redirect",
"url": "https://www.baidu.com/",
"next": {
"method": "input",
"xpath": "//*[@id=\"kw\"]",
"keyword": "和泉雾纱",
"next": {
"method": "click",
"xpath": "//*[@id=\"su\"]"
}
}
}
# Execute script
cpt.Script(script, interval=2)(webdriver)```
## Documenting
If you are interested and would like to see more detailed documentation, please click on the link below.[中文](https://wwydev.gitbook.io/crawlipt-zh "中文文档")|[English](https://wwydev.gitbook.io/crawlipt "English Document")
## Contributing
Please submit pull requests to the develop branch