I'm looking at "Web Scraping Super Introduction" at "Imanyu's Programming Juku" to study scraping.I use Google Colabo.
Serenium seems to have been installed, but I can't install it even if I try various things from chromedriver.
!brew install chromedriver
Even if you type
/bin/bash:brew:command not found
I couldn't find a solution.
So I tried to download it from the web and downloaded "chromedriver_mac64_m1.zip" from the web chromedriver site and tried to run the file, but the message "chromedriver" cannot be opened because the manufacturer has not been identified."
I would appreciate it if you could tell me how to solve this problem or if there are other ways to study scraping.
I look forward to your kind cooperation.
Note: 220822:
After taking advice, I tried again and noticed that there was already an error when installing selenium.
I overlooked the error because it also says successfully below it.
The following occurs:
Does this mean seleniumu is not installed properly?
!pip install selenium
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting selenium
Downloading selenium-4.4.3-py3-none-any.whl (985 kB)
|████████████████████████████████| 985 kB 11.3 MB/s
Collecting urlib3 [socks] to = 1.26
Downloading urlib3-1.26.11-py2.py3-none-any.whl (139kB)
|████████████████████████████████| 139 kB 52.0 MB/s
Collecting trio-websocket~=0.9
Downloading trio_websocket-0.9.2-py3-none-any.whl (16 kB)
Collecting trio~=0.17
Downloading trio -0.21.0-py3-none-any.whl (358 kB)
|████████████████████████████████| 358 kB 45.1 MB/s
Requirement already satified: certifi>=2021.10.8 in/usr/local/lib/python 3.7/dist-packages (from selenium) (2022.6.15)
Requirement already satified: sortedcontainers in /usr/local/lib/python 3.7/dist-packages (from trio~=0.17->selenium) (2.4.0)
Requirement already satified: idnain/usr/local/lib/python 3.7/dist-packages (from trio~=0.17->selenium) (2.10)
Collecting sniffio
Downloading sniffio-1.2.0-py3-none-any.whl (10 kB)
Requirement already satified: attrs>=19.2.0 in/usr/local/lib/python 3.7/dist-packages (from trio~=0.17->selenium) (22.1.0)
Collecting outcome
Downloading outcome-1.2.0-py2.py3-none-any.whl (9.7 kB)
Collecting async-generator > = 1.9
Downloading async_generator-1.10-py3-none-any.whl (18 kB)
Collecting wsproto>=0.14
Downloading wsproto-1.1.0-py3-none-any.whl (24kB)
Requirement already satified: PySocks!=1.5.7, <2.0, >=1.5.6 in/usr/local/lib/python 3.7/dist-packages (from urllib3 [socks] to =1.26->selenium) (1.7.1)
Collecting h11<1,>=0.9.0
Downloading h11-0.13.0-py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 7.7 MB/s
Requirement already satified: typing-extensions in /usr/local/lib/python 3.7/dist-packages (from h11<1,>=0.9.0->wsproto>=0.14->trio-websocket to =0.9-gtien.1)
Installing collected packages: sniffio, outcome, h11, async-generator, wsproto, urlib3, trio, trio-websocket, selenium
Attempting uninstall—urllib3
Found existing installation—urlib31.24.3
Uninstalling urlib3-1.24.3:
Successfully uninstalled urlib3-1.24.3
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts.
requests2.23.0 requirements urlib3!=1.25.0, !=1.25.1, <1.26, >=1.21.1, but you have urlib31.26.11 which is incompatible.
Successfully installed async-generator-1.10 h11-0.13.0 outcome-1.2.0 selenium-4.4.3 sniffio-1.2.0 trio-0.21.0 trio-websocket-0.9.2 urlib3-1.26.11 wsproto-1.1.0
If you're a beginner, you'd better decide whether to study scraping on your PC (Mac) or Google Collaboration (when you get used to it, it's okay to do both, but you'll be confused if you do both first).
】For Google Collaboration br
I think the Google Collaboration operating system is linux.(In my case, it was Ubuntu 18.04.6 LTS.)
I think I can prepare for the scraping below.
#Selenium Installation
! pip install selenium
# chromedriver installation
! apt update
! apt install chromium-chromedriver
!cp/usr/lib/chromium-browser/chromedriver/usr/bin
Also, please refer to Using chromedriver in Google Collaboration (September 2021) and write the code.
Is the video in question here (https://www.youtube.com/watch?v=VRFfAeW30qE)? The instructor seems to be using a local Mac.If you want to do exactly the same thing as the video, I think it would be better to use a local Mac.
© 2024 OneMinuteCode. All rights reserved.