Last active
December 3, 2018 08:38
-
-
Save mindeng/07295dee5a1fa0fdc7bfc4680d16518a to your computer and use it in GitHub Desktop.
extract urls from web page (you can run it from chrome console or code snippets)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // xpath of items | |
| var jd_items_in_cart = '//*/div[1]/div[2]/div/div[2]/div[1]/a'; | |
| var items = document.evaluate(jd_items_in_cart, document, null, XPathResult.ANY_TYPE, null); | |
| while(item=items.iterateNext()) { | |
| console.log(item.href); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment