Created
June 18, 2016 18:59
-
-
Save astocko/d6f8ddb6d8d33a150e908a21b180285f to your computer and use it in GitHub Desktop.
This file contains 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
import markdown | |
from lxml import etree | |
body_markdown = "This is an [inline link](http://google.com). This is a [non inline link][1]\r\n\r\n [1]: http://yahoo.com" | |
doc = etree.fromstring(markdown.markdown(body_markdown)) | |
for link in doc.xpath('//a'): | |
print link.text, link.get('href') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment