0

I have one xpath and I need to use same logic in beautifulsoup

XPATH = .//li/a[@class="js-pagination"][text()!="Next"]

I need to write something like this

pg = soup.find_all('li').findNext('a',attrs={"class":"js-pagination:"})

I don't know what to do next help me to do it

  • Take a look here https://stackoverflow.com/questions/11465555/can-we-use-xpath-with-beautifulsoup – Lupanoide Nov 03 '17 at 10:20
  • You could at least paste above the relevant html elements. Your defined class names are different in two expressions. Anyways, BeautifulSoup doesn't support xpah but it does support css selectors which is more robust and concise. – SIM Nov 04 '17 at 21:03

0 Answers0