S
S
soulless-ghost2020-11-07 12:44:36
Python
soulless-ghost, 2020-11-07 12:44:36

How to parse information from a site that is not hosted on the server?

I have a folder in which correspondence and photos are stored in the form of an html site, but only I can view this site, because it is not hosted anywhere, I am writing a program that would go through all these files, read the code from the site, and if there is a link to photo, wrote this link to a file.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
shurshur, 2020-11-07
@soulless-ghost

If the site is in the form of static files on the disk, then you just need to read these files from the disk instead of requests from the server and freely process the same regular expressions, lxml, bs4 and whatever else your heart desires. It will be even easier here - no need to solve captchas, save cookies and all that.
Of course, you can set up a local web server, but it's like calling a team of surveyors with a theodolite to measure your living room, although it would be better to just buy a tape measure.

J
Jek, 2020-11-07
@jotrib

Perhaps the Requests library will help

S
soremix, 2020-11-07
@SoreMix

File read

V
Vladimir Korotenko, 2020-11-07
@firedragon

https://jasonwatmore.com/post/2016/06/22/nodejs-se...
However, Python also has its own servers
https://codecamp.ru/blog/python-python-http-server/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question