Web Scraping Repl.it
vedprad1 (906)

Web Scraping Repl.it

Has anyone successfuly web scraped repl.it to get the code? When I tried to scrape one of my programs, all I got was this message:
Not sure what to do? Run some examples (start typing to dismiss)

All help appreciated!

You are viewing a single comment. View All
PowerCoder (734)

You can get the html of replit using xpath

from lxml import html
from request import get

replit_page = get('https://repl.it/talk/ask?order=new') #I used replit's ask page
print(replit_page.text) #This will print out the html

replit_html = html.fromstring(replit_page.content)
#That will give you, "Online Music Hackathon," text

Heres a tutorial on how to web scrape with xpath in python https://docs.python-guide.org/scenarios/scrape/
Hope this helped (:

vedprad1 (906)

@PowerCoder : I meant in node.js. Sorry for the unclarity.