简体   繁体   English

Python Dell驱动程序下载

[英]Python Dell driver download

I have been trying my best to get all the dl for drivers using Beautifulsoup4. 我一直在竭尽全力为使用Beautifulsoup4的驱动程序获取所有dl。 however it returns links I don't need. 但是它返回我不需要的链接。 I think they are somehow hidden and for the life of me I can not get them out. 我认为它们某种程度上是隐藏的,对于我的一生,我无法摆脱它们。

here is the page I'm attempting to scrap: http://www.dell.com/support/home/us/en/19/product-support/servicetag/1h1c5p1/drivers 是我要剪贴的页面: http : //www.dell.com/support/home/us/en/19/product-support/servicetag/1h1c5p1/drivers

from bs4 import BeautifulSoup
import urllib2

resp = urllib2.urlopen("http://www.gpsbasecamp.com/national-parks")
soup = BeautifulSoup(resp, from_encoding=resp.info().getparam('charset'))

for link in soup.find_all('a', href=True):
print link['href']

The driver links are loaded by js, so usually you'd have to use selenium or similar clients. 驱动程序链接由js加载,因此通常您必须使用selenium或类似的客户端。 However in this case, all the driver info is available in json format, in a 'text/preloaded' script tag. 但是,在这种情况下,所有驱动程序信息均以json格式提供,位于“文本/预加载”脚本标签中。

from bs4 import BeautifulSoup
import urllib2
import json

resp = urllib2.urlopen("http://www.dell.com/support/home/us/en/19/product-support/servicetag/1h1c5p1/drivers")
soup = BeautifulSoup(resp, 'html.parser', from_encoding=resp.info().getparam('charset'))
data = json.loads(soup.find('script', type='text/preloaded').text)

for item in data:
    print 'Name', item['driverName']
    print 'Link', item['fileFrmtInfo']['httpFileLocation']

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 默认下载目录 Edge web 驱动 - python - Default download directory Edge web driver - python 使用python selenium驱动下载pdf文件 - Using python selenium driver to download pdf file 使用 python selenium 下载文件,使用 firefox 驱动程序正确下载目录 - Download file with python selenium, correct download directory with firefox driver Python Selenium chrome无法通过driver.get(url)下载 - Python selenium chrome doesn't download with driver.get(url) 如何处理在 python 中的 selenium web 驱动程序中单击“下载键”按钮? - How to handle click on “Download key” button in selenium web driver in python? 如何使用 Firefox 驱动程序、Selenium、python 下载 XML 文件 - How to download XML file using Firefox driver, Selenium, python Chrome不断询问我在Python上的Selenium Hub / Driver上的下载位置 - Chrome keep asking me for a download location on Selenium Hub/Driver on Python Dell Boomi 应用程序 (atom.exe) 找不到 python 解释器 - Dell Boomi Application (atom.exe) cannot find python interpreter 与使用 PyODBC 查询数据库的同事共享 Python .exe 时,是否只需要下载 SQL Server 的 ODBC 驱动程序? - When sharing a Python .exe with colleagues that uses PyODBC to query a database, is an ODBC Driver for SQL Server the only download required? 使用 Python 和 SeleniumWebdriver 提交搜索字符串时如何绕过戴尔支持页面上的验证弹出窗口 - How to bypass the validation popup on dell support page when submiting the search string using Python and SeleniumWebdriver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM