用到的工具:
python 2.7——python代码解析器,系统自带,不需要安装
python-selenium——selenium的python化组建,需要安装
spyder——python代码开发运行工具,需要安装
1、安装python-selenium (我们看到,系统自动安装了chromium浏览器,这是因为ARM64下面没有chrome,只能安装开源的chromium)
root@UOS-SHOW019:/home/show01/Downloads/selenium-3.141.0# apt install python-selenium
正在读取软件包列表...完成正在分析软件包的依赖关系树
正在读取状态信息...完成
下列软件包是自动安装的并且现在不需要了:
imageworsener libmaxminddb0 libgtermwidget5-0 libutf8proc2 gtermwidget5-data
使用'apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
chromium chromium-common chromium-driver chroium-sandbox fonts-liberation libu2f-udev notification-daemon python-asnlcrypto python-cffi-backend python-cryptography python-enum34 python-idna python-ipaddress python-openssl python-urllib3
建议安装:
chromium-l10n chromium-shell python-cryptography-doc python-cryptography-vectors python-enum34-doc python-openssl-doc python-openssl-dbg firefoxdriver python-ntlm python-socks
下列[新]软件包将被安装:
chromium chromium-common chronium-driver hromium-sandbox fonts-liberation libu2f-udev notification-daemon python-asnlcrypto python-cffi-backend python-cryptography python-enum34 python-idna python-ipaddress python-openssl python-selenium python-urllib3
升级了0个软件包,新安装了16 个软件包,要卸载0个软件包,有8个软件包未被升级。
需要下载56.5MB的归档。
解压缩后会消耗202MB的额外空间。
您希望继续执行吗?[Y/n] y
获取:1 https://uos.deepin.cn/uos eagle/main arm64 chromium-common arm64 79.0.3945.130-1~deb10u1 [256 kB)
获取:2 https://uos.deepin.cn/uos eagle/main arm64 chromium arm64 79.0.3945.130-1~deb10u1 [49.3 MB]
获取:3 https://uos.deepin.cn/uos eagle/main arm64 chromium-driver arm64 79.0.3945130-1~deb10u1 [5168 kB]
获取:4 https://uos.deepin.cn/uos eagle/main arm64 chromium-sandbox arm64 79.0.3945.130-1~deb10u1 [141 kB]
获取:5 https://uos.deepin.cn/uos eagle/main arm64 fonts-liberation all 1:1.07.4-9[827 kB]
获取 :6 https://uos.deepin.cn/uos eagle/main arm64 libu2f-udev all1.1.9-1 [7,344 B]
获取:7 https://uos.deepin.cn/uos eagle/main notification-daemon arm64 3.20.0-4[59.3 kB]
获取:8 https://uos.deepin.cn/uos eagle/main arm64 python-asn1crypto all 0.24.0-1 [78.1 kB]
获取:9 https://uos.deepin.cn/uos eagle/main arm64 arm64python-cffi-backend arm641.12.2-1[79.4 kB]
获取:10 https://uos.deepin.cn/uos eagle/main arm64 python-enum34 all 1.1.6-2 [35.2 kB]
获取:11 https://uos.deepin.cn/uos eagle/main arm64 python-ipaddress all 1.0.17-1 [18.2 kB]
获取:12 https://uos.deepin.cn/uos eagle/main arm64 python-cryptography arm64 2.6.1-3+deb10u2 [201 kB]
获取:13 https://uos.deepin.cn/uos eagle/main arm64 python-idna all 2.6-1 [34.1 kB]
2、安装spyder
root@UOS-SHOW019:/usr/lib/python2.7/dist-packages# apt install spyder
正读取软件包列表...完成
正在分析软件包的依赖关系树
在读取状态信息...完成
下列软件包是自动安装的并且现在不需要了:
imageworsener libmaxminddb0 libgtermwidget5-0 qtermwidget5-data
使用'apt autoremove'来卸载它(它们)。
下列[新] 软件包将被安装:
spyder
升级了 0个软件包,新安装了 1个软件包,要卸载 0个软件包,有 8 个软件包未被升级。
需要下载128 kB 的归档。
解压缩后会消耗 219 kB 的额外空间。
获取:1 https://uos.deepin.cn/uos eagle/main arm64 spyder all 3.3.3+dfsg1-1 [128 kB]
已下载128kB,耗时5秒(24.5 kB/s)
正在选中未选择的软件包spyder。
(正在读取数据库 ...系统当前共安装有 221578 个文件和目录。)
准备解压.../spyder_3.3.3+dfsg1-1 all.deb...
正在解压 spyder (3.3.3+dfsg1-1)...
正在设置 spyder (3.3.3+dfsg1-1)...
在处理用于 bamfdaemon (0.5.4-1)的触发器...
3、进行代码开发,这里做了个简单的实例,仅供参考
from selenium import webdriver
from selenium.webdriver.support.ui import Select
driver = webdriver.Chrome()
driver.get( "http://www.kylinos.cn/wsearch.aspx?category_id=40" )
driver.maximize_window()
#driver.find_element_by_xpath('//*[@class="search-by by-category relative"]/dl[4]/dd/select').click()
select1 = Select(driver.find_element_by_xpath( '//*[@class="search-by by-category relative"]/dl[4]/dd/select' ))
select1.select_by_visible_text( "arm64" )
for i in range ( 2 , 21 ):
companyName = driver.find_element_by_xpath( '//table[@class="mtable"]/tbody/tr[' + str (i) + ']/td[1]' ).text
print (companyName)
4、效果如下


用到的工具:
python 2.7——python代码解析器,系统自带,不需要安装
python-selenium——selenium的python化组建,需要安装
spyder——python代码开发运行工具,需要安装
1、安装python-selenium (我们看到,系统自动安装了chromium浏览器,这是因为ARM64下面没有chrome,只能安装开源的chromium)
root@UOS-SHOW019:/home/show01/Downloads/selenium-3.141.0# apt install python-selenium
正在读取软件包列表...完成正在分析软件包的依赖关系树
正在读取状态信息...完成
下列软件包是自动安装的并且现在不需要了:
imageworsener libmaxminddb0 libgtermwidget5-0 libutf8proc2 gtermwidget5-data
使用'apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
chromium chromium-common chromium-driver chroium-sandbox fonts-liberation libu2f-udev notification-daemon python-asnlcrypto python-cffi-backend python-cryptography python-enum34 python-idna python-ipaddress python-openssl python-urllib3
建议安装:
chromium-l10n chromium-shell python-cryptography-doc python-cryptography-vectors python-enum34-doc python-openssl-doc python-openssl-dbg firefoxdriver python-ntlm python-socks
下列[新]软件包将被安装:
chromium chromium-common chronium-driver hromium-sandbox fonts-liberation libu2f-udev notification-daemon python-asnlcrypto python-cffi-backend python-cryptography python-enum34 python-idna python-ipaddress python-openssl python-selenium python-urllib3
升级了0个软件包,新安装了16 个软件包,要卸载0个软件包,有8个软件包未被升级。
需要下载56.5MB的归档。
解压缩后会消耗202MB的额外空间。
您希望继续执行吗?[Y/n] y
获取:1 https://uos.deepin.cn/uos eagle/main arm64 chromium-common arm64 79.0.3945.130-1~deb10u1 [256 kB)
获取:2 https://uos.deepin.cn/uos eagle/main arm64 chromium arm64 79.0.3945.130-1~deb10u1 [49.3 MB]
获取:3 https://uos.deepin.cn/uos eagle/main arm64 chromium-driver arm64 79.0.3945130-1~deb10u1 [5168 kB]
获取:4 https://uos.deepin.cn/uos eagle/main arm64 chromium-sandbox arm64 79.0.3945.130-1~deb10u1 [141 kB]
获取:5 https://uos.deepin.cn/uos eagle/main arm64 fonts-liberation all 1:1.07.4-9[827 kB]
获取 :6 https://uos.deepin.cn/uos eagle/main arm64 libu2f-udev all1.1.9-1 [7,344 B]
获取:7 https://uos.deepin.cn/uos eagle/main notification-daemon arm64 3.20.0-4[59.3 kB]
获取:8 https://uos.deepin.cn/uos eagle/main arm64 python-asn1crypto all 0.24.0-1 [78.1 kB]
获取:9 https://uos.deepin.cn/uos eagle/main arm64 arm64python-cffi-backend arm641.12.2-1[79.4 kB]
获取:10 https://uos.deepin.cn/uos eagle/main arm64 python-enum34 all 1.1.6-2 [35.2 kB]
获取:11 https://uos.deepin.cn/uos eagle/main arm64 python-ipaddress all 1.0.17-1 [18.2 kB]
获取:12 https://uos.deepin.cn/uos eagle/main arm64 python-cryptography arm64 2.6.1-3+deb10u2 [201 kB]
获取:13 https://uos.deepin.cn/uos eagle/main arm64 python-idna all 2.6-1 [34.1 kB]
2、安装spyder
root@UOS-SHOW019:/usr/lib/python2.7/dist-packages# apt install spyder
正读取软件包列表...完成
正在分析软件包的依赖关系树
在读取状态信息...完成
下列软件包是自动安装的并且现在不需要了:
imageworsener libmaxminddb0 libgtermwidget5-0 qtermwidget5-data
使用'apt autoremove'来卸载它(它们)。
下列[新] 软件包将被安装:
spyder
升级了 0个软件包,新安装了 1个软件包,要卸载 0个软件包,有 8 个软件包未被升级。
需要下载128 kB 的归档。
解压缩后会消耗 219 kB 的额外空间。
获取:1 https://uos.deepin.cn/uos eagle/main arm64 spyder all 3.3.3+dfsg1-1 [128 kB]
已下载128kB,耗时5秒(24.5 kB/s)
正在选中未选择的软件包spyder。
(正在读取数据库 ...系统当前共安装有 221578 个文件和目录。)
准备解压.../spyder_3.3.3+dfsg1-1 all.deb...
正在解压 spyder (3.3.3+dfsg1-1)...
正在设置 spyder (3.3.3+dfsg1-1)...
在处理用于 bamfdaemon (0.5.4-1)的触发器...
3、进行代码开发,这里做了个简单的实例,仅供参考
from selenium import webdriver
from selenium.webdriver.support.ui import Select
driver = webdriver.Chrome()
driver.get( "http://www.kylinos.cn/wsearch.aspx?category_id=40" )
driver.maximize_window()
#driver.find_element_by_xpath('//*[@class="search-by by-category relative"]/dl[4]/dd/select').click()
select1 = Select(driver.find_element_by_xpath( '//*[@class="search-by by-category relative"]/dl[4]/dd/select' ))
select1.select_by_visible_text( "arm64" )
for i in range ( 2 , 21 ):
companyName = driver.find_element_by_xpath( '//table[@class="mtable"]/tbody/tr[' + str (i) + ']/td[1]' ).text
print (companyName)
4、效果如下