K
K
Kosyak262020-07-21 20:43:43
Python
Kosyak26, 2020-07-21 20:43:43

How to adjust the path to the site file to the correct Python format?

Good day, I've been scratching my head over the problem for several days now.
The task is as follows:
At the input we are given a large list of sites (format site.com, https://site.com , www.site.com )
It is required to translate all sites into the desired format ( https://site.com ) that would later get the contents of the ads.txt file.
For example, through requests, I can only get the file by specifying the full path https://site.com/ads.txt . But I can't follow the path site.com/ads.txt
Help, give some ideas. In which direction should I move? Can use something else? I don't want to write huge designs

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-07-21
@Kosyak26

Insert protocol via regex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question