crawlist
introduction
installing
quickly start
Last updated
Last updated
import crawlist as cl
if __name__ == '__main__':
# Initialize a pager to implement page flipping
pager = cl.StaticRedirectPager(uri="https://www.douban.com/doulist/893264/?start=0&sort=seq&playable=0&sub_type=",
uri_split="https://www.douban.com/doulist/893264/?start=%v&sort=seq&playable=0&sub_type=",
start=0,
offset=25)
# Initialize a selector to select the list element
selector = cl.CssSelector(pattern=".doulist-item")
# Initialize an analyzer to achieve linkage between pagers and selectors
analyzer = cl.AnalyzerPrettify(pager, selector)
res = []
limit = 100
# Iterating a certain number of results from the analyzer
for tr in analyzer(limit):
print(tr)
res.append(tr)
# If all the data has been collected, the length of the result will be less than the limit
print(len(res))import crawlist as cl
if __name__ == '__main__':
# Initialize a pager to implement page flipping
pager = cl.DynamicScrollPager(uri="https://ec.ltn.com.tw/list/international")
# Initialize a selector to select the list element
selector = cl.CssSelector(pattern="#ec > div.content > section > div.whitecon.boxTitle.boxText > ul > li")
# Initialize an analyzer to achieve linkage between pagers and selectors
analyzer = cl.AnalyzerPrettify(pager=pager, selector=selector)
res = []
# Iterating a certain number of results from the analyzer
limit = 100
for tr in analyzer(limit):
print(tr)
res.append(tr)
print(len(res))
# After completion, you need to close the webdriver, otherwise it will occupy your memory resources
pager.webdriver.quit()