Ask coding questions

← Back to all posts
Web Scraping
vedprad1 (906)

Web Scraping

Has anyone successfuly web scraped 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!

mat1 (4381)

This isn't exactly web scraping, but I made a small program 2 days ago that does this
Please mark this comment as the answer if it helped. Thanks!

PowerCoder (734)

You can get the html of replit using xpath

from lxml import html
from request import get

replit_page = get('') #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
Hope this helped (:

vedprad1 (906)

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

ash15khng (712)

I don't think anyone has ever tried, and I don't think was made for getting code information from web scraping.

Geocube101 (624)

The most I've done is make a program to get the number of cycles a user has