[Python] Punch in the eighth day of learning - selenium automation browser (on)


Event address: CSDN 21-day learning challenge

The biggest reason for learning is to get rid of mediocrity. One day earlier, there will be more splendor in life; Dear friends, if you:
want to systematically/deeply learn a certain technical knowledge point...
it is difficult to persist in learning alone, and want to learn efficiently in a group...
want to write a blog but can't start, and urgently need to inject energy into writing dry goods...
love writing, willing to let yourself become better people

...

Welcome to participate in the CSDN Learning Challenge and become a better self. Please refer to the free high-quality column resources of the high-quality column bloggers in the event (this part of the high-quality resources is free and open for a limited time in the event~), according to your own learning field and learning progress Learn and document your own learning process. You can choose one of the following three aspects to start (not mandatory), or publish column learning works according to your own understanding, as follows:

**

study diary

**
1. Learning knowledge points

Selenium tests web frameworks, simulators, emulators, and anti-pickup.
Webdriver driver download address: http://chromedriver.storage.googleapis.com/index.html

2. Problems encountered in learning

API not touched

3. Learning gains

Selenium's api usage

4. Practical operation

Installation related:

1. cmd command line: pip install selenium

Open a browser:

from selenium import webdriver

# Browser initialization
browser = webdriver.Chrome()
# Send request
browser.get('https://www.baidu.com/')

# Print the title of the page
print(browser.title)

# Quit the simulated browser
browser.quit() # Be sure to quit! If you don't exit, there will be residual processes

Guess you like

Origin blog.csdn.net/qq_34217861/article/details/126453391
Recommended