1. Ensure that the ChromeDriver version is consistent with the browser version

Python interpreter is best done using python from an environment variable. This will behave the same on the command line and in Pycharm and will avoid many problems (PIP install after compiling and package not found, etc.).

3. Python can be used as a simple Web server and is easy to use

Can consult in detail here: blog.csdn.net/xiabenshu/a…

from http.server import BaseHTTPRequestHandler, HTTPServer class RequestHandler(BaseHTTPRequestHandler): "' process the request and returns the Page '# Page template Page ="' \ < HTML > < body > < p > Hello, web! < / p > < / body > < / HTML > "' # processing a GET request def do_GET (self) : self.send_response(200) self.send_header("Content-Type", "text/html") self.send_header("Content-Length", str(len(self.Page))) self.end_headers() self.wfile.write(self.Page.encode('utf-8')) if __name__ == '__main__': serverAddress = ('', 8080) server = HTTPServer(serverAddress, RequestHandler) server.serve_forever()Copy the code