Skip to content

Instantly share code, notes, and snippets.

@voidfiles
Last active December 13, 2015 16:48
Show Gist options
  • Select an option

  • Save voidfiles/4942564 to your computer and use it in GitHub Desktop.

Select an option

Save voidfiles/4942564 to your computer and use it in GitHub Desktop.
Grab a whole webpage in Mobile Safari and send it to Pythonista.
# 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