Last active
December 13, 2015 16:48
-
-
Save voidfiles/4942564 to your computer and use it in GitHub Desktop.
Grab a whole webpage in Mobile Safari and send it to Pythonista.
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
| # Parse a whole pages HTML, and sends it to pythonista for furthter editing. | |
| # the bookmarklet | |
| # javascript:var selected=encodeURIComponent(document.body.innerHTML);location.href='pythonista://parsepage?action=run&argv=['+encodeURIComponent(document.title)+']('+encodeURIComponent(location.href)+')'+selected; | |
| import sys | |
| print sys.argv | |
| # From here I figure out could use bs4 to create a tag whitelist, then send it through html2md | |
| # Could also look at using diffbot API to parse out the main content. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment