admin管理员组

文章数量:1535087

使用python完成模拟浏览器操作主要是使用selenium来模拟浏览器,当然还要带上浏览器的驱动比如chromedriver.exe的驱动。

一般使用selenium进行模拟操作需要注意引入一下几个类:

selenium webdriver

selenium.webdrivermon.by By

selenium.webdriver.support.ui WebDriverWait

selenium.webdriver.support expected_conditions EC

seleniummon.exceptions TimeoutException

selenium是webdrive中的东西,只要安装了selenium之后就可以了。expected_conditions可以调用防止超时的组件,防止页面没有完全加载。

browser = webdriver.Chrome(executable_path="D:/scrapytest/price_test/tools/chromedriver.exe")

这里是直接创建webdriver实例。browser.get('http://jr.jd/')

使用browser.get()进行链接跳转。

本文标签: 浏览器操作用户Python