driver = webdriver.Chrome('chromedriver.exe')
driver.get('https://www.iimbx.edu.in/dashboard')
user_input = driver.find_element_by_id('login-email')
user_input.send_keys(USERNAME)
user_password = driver.find_element_by_id('login-password')
user_password.send_keys(PASSWORD)
button = driver.find_element_by_xpath('//*[@id="login"]/div[4]/button')
button.click()
res = driver.execute_script("return document.documentElement.outerHTML")
soup = BeautifulSoup(res, 'html.parser')
courses_list = box.find_all('h2', {'class':'mycourse_title'})
for a in courses_list:
for a in courses_list.find_all('a', href=True):
print(a['href'])
Но я получаю ошибку, подобную этой:
AttributeError Traceback (most recent call last)
<ipython-input-51-64e553ba2d72> in <module>
18
19 for a in courses_list:
---> 20 for a in courses_list.find_all('a', href=True):
21 print(a['href'])
AttributeError: ResultSet object has no attribute 'find_all'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?