https://github.com/leafney/alpine-selenium-firefox
Alpine:v3.4 + Selenium +Firefox
https://github.com/leafney/alpine-selenium-firefox
Last synced: 3 months ago
JSON representation
Alpine:v3.4 + Selenium +Firefox
- Host: GitHub
- URL: https://github.com/leafney/alpine-selenium-firefox
- Owner: leafney
- Created: 2016-10-23T11:51:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-07T15:55:31.000Z (over 8 years ago)
- Last Synced: 2025-01-14T15:23:46.660Z (5 months ago)
- Size: 1.35 MB
- Stars: 6
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#### 说明
Alpine:v3.4 + Selenium +Firefox
#### 创建镜像
```
$ docker build -t="leafney/alpine-selenium-firefox" .
```#### 创建一个容器进行测试
```
$ docker run -it --name alseff leafney/alpine-selenium-firefox /bin/sh
```#### 拷贝 py 文件到容器中
```
$ docker cp firefox.py alseff:/root
```#### Size
leafney/alpine-selenium-firefox latest 251.3 MB
***
#### Selenium + Firefox Demo
```
# coding:utf-8import time
from selenium import webdriver
from pyvirtualdisplay import Displaydisplay = Display(visible=0, size=(800, 800))
display.start()driver = webdriver.Firefox()
driver.get('http://www.cnblogs.com/')time.sleep(5)
title = driver.title
print(title.encode('utf-8'))# html=driver.page_source
# print(html)# Release memory
driver.close()
driver.quit()
display.stop()
```