{"id":234954,"date":"2022-02-05T09:49:16","date_gmt":"2022-02-05T01:49:16","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=234954"},"modified":"2022-01-29T15:49:41","modified_gmt":"2022-01-29T07:49:41","slug":"python-selenium-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/python-selenium-linux.html","title":{"rendered":"\u6559\u4f60\u4e24\u79cdpython selenium\u4fdd\u5b58\u56fe\u7247\u7684\u65b9\u6cd5"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u5927\u5bb6\u597d\uff0c\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u8bb2\u7684\u662fpython selenium\u4fdd\u5b58\u56fe\u7247\u6700\u597d\u7684\u4e24\u79cd\u65b9\u6cd5\uff0c\u611f\u5174\u8da3\u7684\u540c\u5b66\u8d76\u5feb\u6765\u770b\u4e00\u770b\u5427\uff0c\u5bf9\u4f60\u6709\u5e2e\u52a9\u7684\u8bdd\u8bb0\u5f97\u6536\u85cf\u4e00\u4e0b<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n selenium\u722c\u53d6\u9875\u9762\u65f6\u7ecf\u5e38\u9047\u5230\u8981\u4fdd\u5b58\u56fe\u7247\u7684\u9700\u6c42\uff0c\u901a\u5e38\u7684\u505a\u6cd5\u662f\u83b7\u53d6\u94fe\u63a5\u540e\u7528 requests \u4e0b\u8f7d\uff0c\u4f46\u8fd9\u79cd\u65b9\u6cd5\u8131\u79bb\u4e86selenium\u73af\u5883\uff0c\u5982\u9047\u5230\u6709\u6821\u9a8c\u7684\u60c5\u51b5\u8fd8\u9700\u8981\u7ed5\u8fc7\u6821\u9a8c\u3002<\/p>\n \u4e0b\u9762\u4ecb\u7ecd\u4e24\u79cd\u76f4\u63a5\u901a\u8fc7selenium\u4fdd\u5b58\u56fe\u7247\u7684\u65b9\u6cd5\uff1a<\/p>\n 1. \u901a\u8fc7\u6293\u5305<\/strong><\/div>\n selenium-wire \u662fselenium\u6269\u5c55\uff0c\u5b83\u53ef\u4ee5\u5bf9\u6240\u6709\u8bf7\u6c42\u6293\u5305\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u4fee\u6539\u8bf7\u6c42\u5934\uff0c\u8bf7\u6c42body\uff0c\u8bf7\u6c42\u8fd4\u56de\u503c\u7b49\uff0c\u529f\u80fd\u975e\u5e38\u5f3a\u5927\u3002<\/p>\n selenium-wire \u7684\u4f7f\u7528\u548cselenium\u4e00\u6837\uff0c\u4f60\u53ea\u4eceseleniumwire\u5bfc\u5165webdriver\u5c31\u884c\uff0c\u5bf9\u4e8e\u5176\u4ed6\u5305\u8fd8\u662f\u4eceselenium\u5bfc\u5165<\/p>\n \r\nfrom selenium.webdriver.chrome.options import Options\r\nfrom seleniumwire.webdriver import Chrome\r\n \r\ndriver = Chrome(options= Options())<\/pre>\n |