Try95th

queue_scrawler_sampleUsage

Nov 18th, 2022 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. ## Outputs saved at https://bit.ly/qscrawl_samplop ##
  2. #### [copy to own drive to interact with filters] ##
  3. #### [json files saved as rows in first sheet] ##
  4.  
  5. from queue_scrawler_reqs import * ## download or paste from https://pastebin.com/TBtYja5D
  6.  
  7. ######################## FIRST TIME ########################
  8. setGlobals({'starterUrl': 'https://en.wikipedia.org/wiki/Special:Random'})
  9. nextUrl = get_next_fromScrawlQ()
  10. while nextUrl: nextUrl = logScrape(scrapeUrl(nextUrl))
  11. saveScrawlSess('qScrawl1.csv', 'vScrawl1.json')
  12. ############################################################
  13.  
  14.  
  15. ######################## NEXT TIME ########################
  16. loadScrawlSess('qScrawl1.csv', 'vScrawl1.json', 'q<--page_limit_exceeded')
  17. nextUrl = get_next_fromScrawlQ()
  18. while nextUrl: nextUrl = logScrape(scrapeUrl(nextUrl))
  19. saveScrawlSess('qScrawl2.csv', 'vScrawl2.json')
  20. ###########################################################
  21.  
Add Comment
Please, Sign In to add comment