0

I am getting an error "AttributeError: 'NoneType' object has no attribute 'find_all'". I googled why the error occurred but couldn't find an answer. Does anyone know why the error comes out?

 for page in range(pages):
    base_url = "https://kr.indeed.com/jobs"
    final_url = f"{base_url}?q={keyword}&start={page*10}"
    
    print("Requesting", final_url)
    
    browser.get(final_url)
    soup = BeautifulSoup(browser.page_source, "html.parser")
    job_list = soup.find("ul", class_="jobsearch-ResultsList")
    jobs = job_list.find_all("li", recursive=False)  

I want to fix the error and know what the error exactly about.

bereal
  • 32,519
  • 6
  • 58
  • 104
DAKI
  • 1
  • 2
    Like [the docs say](https://beautiful-soup-4.readthedocs.io/en/latest/index.html?highlight=find#find): if `find()` can’t find anything, it returns `None`. – bereal Apr 11 '23 at 06:01
  • Either print out or inspect job_list. It will be None, as I am guessing that B BeautifulSoup isn't finding any ul with that class – Doon Apr 11 '23 at 06:01

0 Answers0