[Python] Introduction to scraping | Program to open web pages (selenium webdriver)

[Python] Introduction to scraping | Program to open web pages (selenium webdriver)

Use the selenium module tool webdriver.

Explains how to open any page of chrome using webdriver.


## manner

1. 1. Preparation

** ① Download "chrmoedriver.exe" **

Downloadable from this site

> From the Current stable release link
image.png
image.png

** ② Save the DL file in the same hierarchy as the .py file **

You can specify it by path, but save it in the same folder for simplification.


### 2. Coding

python


from selenium import webdriver
browser = webdriver.Chrome('chromedriver.exe')

url = 'https://qiita.com/'
browser.get(url)

That's it.

from selenium import webdriver Install webdriver for selenium module

browser = webdriver.Chrome('chromedriver.exe') Launch chrome with webdriver

url = 'https://qiita.com/' Specify the URL. Here is the qiita top page.

browser.get(url) Open the url specified by the get method

「webdriver.Chrome('chromedriver.exe').get('https://qiita.com/')」

Recommended Posts

[Python] Introduction to scraping | Program to open web pages (selenium webdriver)
Introduction to Web Scraping
Python web scraping selenium
Web scraping using Selenium (Python)
[Python] Introduction to web scraping | Summary of methods that can be used with webdriver
Selenium and python to open google
Automatically manipulate web pages using selenium webdriver
Practice web scraping with Python and Selenium
Selenium + WebDriver (Chrome) + Python | Building environment for scraping
How to open a web browser from python
I tried web scraping using python and selenium
Introduction to Tornado (1): Python web framework started with Tornado
Scraping dynamically loaded TV program listings [Python] [Selenium]
[Python] Flow from web scraping to data analysis
[Introduction to Python3 Day 20] Chapter 9 Unraveling the Web (9.1-9.4)
[2021 version] From Selenium Basic installation to Web scraping execution by Python Windows 10 (64bit)
Introduction to Python language
Introduction to OpenCV (python)-(2)
Scraping with Selenium [Python]
I was addicted to scraping with Selenium (+ Python) in 2020
Introduction to Python Django (2) Win
Scraping with selenium in Python
Web scraping notes in python3
Scraping with Selenium in Python
Start to Selenium using python
Selenium WebDriver + Firefox49 (provisional) (Python)
Introduction to serial communication [Python]
[Introduction to Python] <list> [edit: 2020/02/22]
Introduction to Python (Python version APG4b)
Scraping with Selenium + Python Part 2
An introduction to Python Programming
[Python + Selenium] Tips for scraping
Web scraping beginner with python
Challenge Python3 and Selenium Webdriver
Introduction to Python For, While
[EC2] Introduction to scraping using selenium (text extraction and screen capture)
[Introduction to Udemy Python 3 + Application] 58. Lambda
Introduction to Python Numerical Library NumPy
Practice! !! Introduction to Python (Type Hints)
[Introduction to Python3 Day 1] Programming and Python
Web scraping with Python ① (Scraping prior knowledge)
Scraping with Selenium in Python (Basic)
[Introduction to Python] <numpy ndarray> [edit: 2020/02/22]
[Introduction to Udemy Python 3 + Application] 57. Decorator
Scraping with Python, Selenium and Chromedriver
Introduction to Python Hands On Part 1
[Introduction to Python3 Day 13] Chapter 7 Strings (7.1-7.1.1.1)
Web scraping with Python First step
I tried web scraping with python.
[Introduction to Python] How to parse JSON
[Introduction to Udemy Python 3 + Application] 56. Closure
[Introduction to Python3 Day 14] Chapter 7 Strings (7.1.1.1 to 7.1.1.4)
Introduction to Protobuf-c (C language ⇔ Python)
[EC2] How to run selenium webdriver
[Introduction to Udemy Python3 + Application] 59. Generator
[Introduction to Python3 Day 15] Chapter 7 Strings (7.1.2-7.1.2.2)
[Introduction to Python] Let's use pandas
Beginners use Python for web scraping (1)
[Introduction to Python] Let's use pandas
[Introduction to Udemy Python 3 + Application] Summary
Introduction to image analysis opencv python