{
"method": "redirect",
"url": "https://www.baidu.com/",
"next": {
"method": "inputKeyword",
"xpath": "//*[@id=\"kw\"]",
"keyword": "和泉雾纱",
"next": {
"method": "click",
"xpath": "//*[@id=\"su\"]"
}
}
}
import crawlist as cl
class MyPager(cl.DynamicNumButtonPager):
def pre_load(self, webdriver: WebDriver) -> None:
script = {
"method": "redirect",
"url": "https://www.baidu.com/",
"next": {
"method": "inputKeyword",
"xpath": "//*[@id=\"kw\"]",
"keyword": "和泉雾纱",
"next": {
"method": "click",
"xpath": "//*[@id=\"su\"]"
}
}
}
cl.Script(script)(webdriver)