Selenium checks whether the call to the chrom driver is successful

Selenium+python3+chrome environment configuration

1. Install python (cmd input python to judge)

2. Install selenium (download the installation package, cmd enters python setup.py install in the selenium directory) to install

3. Download the chromewebdriver installation package and put it in the python directory

4. Python can call chrome.

#coding:utf-8

from selenium import webdriver

from time import sleep

def main():

    b=webdriver.Chrome()

    url="https://mp.csdn.net/postedit"

    b.get(url)

    print ("ok" )

    sleep(5)

    b.quit()

if __name__ == '__main__':

    main()

to check if the call was successful

WeChat can be added: dd198910242010

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325981260&siteId=291194637
Recommended