from selenium import webdriver
chrome = webdriver.Chrome()
chrome.get('https://www.bilibili.com')
ul = chrome.find_element_by_xpath('//*[@id="primary_menu"]/ul')
lis = ul.find_elements_by_xpath('li')
len(lis)    # 有多少个li
lis[-1].text  # 最后一个li

相关文章:

  • 2022-01-03
  • 2021-12-06
  • 2022-12-23
  • 2021-07-07
  • 2021-11-29
  • 2021-11-29
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
相关资源
相似解决方案