Selenium error message “selenium.webdriver has no attribute execute script”

前端 未结 3 735
北恋
北恋 2021-01-13 23:24

I am using selenium to scrape an infinite scrolling page.

I am trying to use this code:

import time
import pandas as np
import numpy as np

from sele         


        
3条回答
  •  伪装坚强ぢ
    2021-01-13 23:56

    webdriver is the name of the module, not your instance of it. In fact, you assigned the instance you created to the name browser with this line: browser = webdriver.Chrome()

    so instead of calling webdriver.execute_script() (which will give you an AttributeError), you must call it using your instance, like this: browser.execute_script().

提交回复
热议问题