Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. for(const sect of sections ){
  2.  
  3. // Now collect all the URLs
  4. const appUrls = await page.$$eval('div.main > ul.app-list > li > div.app-info a.app-info-icon', links => links.map(link => link.href));
  5.  
  6. // Visit each URL one by one and collect the data
  7. for (let appUrl of appUrls) {
  8. var count = i++;
  9. try{
  10. await page.goto(appUrl);
  11. const appName = await page.$eval('div.det-name-int', div => div.innerText.trim());
  12. console.log('n' + count);
  13. console.log(appName);
  14. } catch(e){
  15. console.log('n' + count);
  16. console.log('ERROR');
  17. await page.reload();
  18. }
  19.  
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement