I tried to store various pages as list by using request_HTML. whereas unable to store entire pages, could you help to store as list of page links...
may i know where am missing?. May i know how to create a pagination like scrapy?
from requests_html import HTMLSession
def pagecheck(checkl):
x=se.get(checkl)
if x.html.find('div.isaiminida'):
print (''.join(x.html.find('a.pagination_next',first=True).absolute_links))
xplink= (''.join(x.html.find('a.pagination_next',first=True).absolute_links))
if x.html.find('a.pagination_next'):
pages.append(xplink);return p(xplink)
else:
print ('Page doesnt exist')
def p(xplink):
x=se.get(xplink)
if x.html.find('a.pagination_next'):
pagecheck(x.url)
else:
print (z,'\t Pages scrape completed.....')
return pages
if __name__ == '__main__':
#:: movies index
xa = ['a','z','c']
for z in xa:
url = f'https://isaidubb.co/tamil-atoz-dubbed-movies/{z}'
se = HTMLSession()
x=se.get(url)
pages =[];px=[]
pages=pagecheck(x.url)
source https://stackoverflow.com/questions/68525323/requests-html-pagination-list-could-not-be-stored
Comments
Post a Comment