pyppeteer initial run solutions need to download Chrome can not download

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/wangliuqi123/article/details/95621126

First install pyppeteer:

pip install pyppeteer

First run will download Chrome :( you will see the phrase)

If your machine is not out of the machine, you could be waiting long long long time. But also not installed.

It offers two solutions here: 1: change the configuration file (provided behind Baidu Cloud runs the download address). 2: Add parameters.

pyppeteer demo Demo Address: https://github.com/1414044032/pyppeteer_taobao

chrome-win32 Baidu Cloud: link: https: //pan.baidu.com/s/1kIRdQSHgpWo4ljJNxtwHVQ extraction code: v8zh 

So here we need to modify pyppeteer the original code, the download of this step is to disable the swap.

First, find the download code: it is in your python editor where Lib \ site-packages \ pyppeteer \ chromium_downloader.py.
You can use everything to find the location of the file here :( I used a virtual environment and the local environment are installed pyppeteer, so there will be two files)

Around 154 or so aircraft have a function to determine whether there is chrome.exe, we modify the function print it and see:

We see here that the path exists to detect and then decide whether to download, so we have to manually create this directory to the root directory browser running:

 之后把chrome的压缩包解压到这个目录:

之后再跑程序就不会让下载了。

2:pyppeteer提供了参数让我写chrome的运行位置。可以直接写本地chrome的位置。(可能会运行报错,因为版本兼容等原因

Guess you like

Origin blog.csdn.net/wangliuqi123/article/details/95621126