https://github.com/tsotsi/python_utils
https://github.com/tsotsi/python_utils
crawl python3 screenshot selenium utils
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tsotsi/python_utils
- Owner: Tsotsi
- License: mit
- Created: 2019-06-17T17:49:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T21:14:14.000Z (about 2 years ago)
- Last Synced: 2024-11-13T09:27:48.847Z (12 months ago)
- Topics: crawl, python3, screenshot, selenium, utils
- Language: Python
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-utils
python utils
### ScreenShot
```python3
browser = get_browser('https://tushare.pro/document/2?doc_id=33')
# 移除悬浮
browser.execute_script("""
var toTop = document.querySelector('.scroll-to-top');
if(toTop){
toTop.remove();
}
""")
# 隐藏滚动条
browser.execute_script("""
var style = document.createElement('style');
style.innerHTML='body::-webkit-scrollbar{display:none;}';
document.querySelector('head').append(style);
""")
screen_shot = ScreenShot()
screen_shot.save_full_page_screen_shot('ts.jpg', browser=browser)
browser.quit()
```