Skip to content

Instantly share code, notes, and snippets.

@jtg567
Created December 2, 2015 00:14
Show Gist options
  • Select an option

  • Save jtg567/17989f5b4bd9e0b87e2d to your computer and use it in GitHub Desktop.

Select an option

Save jtg567/17989f5b4bd9e0b87e2d to your computer and use it in GitHub Desktop.

Revisions

  1. jtg567 created this gist Dec 2, 2015.
    7 changes: 7 additions & 0 deletions scrape.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    from lxml import html
    import requests

    #scrape periscope desktop page; meta tag token-id content is empty when not streaming
    page = requests.get('https://www.periscope.tv/<replace username>')
    tree = html.fromstring(page.content)
    air_status = tree.xpath('//*[@id="token-id"]/@content')