Home > Mobile >  selenium.common.exceptions.InvalidSelectorException
selenium.common.exceptions.InvalidSelectorException

Time:09-23

Trying to scrape image of class i'm trying to get

CodePudding user response:

CLASS_NAME like c4mnd7m dir dir-ltr (with spaces) does not work, it should be a CSS_SELECTOR instead.

Removing the spaces and putting the . would do the job.

Effective code changes:

listings = browser.find_elements(By.CSS_SELECTOR, '.c4mnd7m.dir.dir-ltr')

similar changes you would have to make wherever you've class name with spaces

  • Related