Skip to content

Instantly share code, notes, and snippets.

@jtg567
Created December 2, 2015 00:14
Show Gist options
  • Save jtg567/17989f5b4bd9e0b87e2d to your computer and use it in GitHub Desktop.
Save jtg567/17989f5b4bd9e0b87e2d to your computer and use it in GitHub Desktop.
Scrape token-id from periscope.com with python (lxml and request)
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')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment