Answer the question
In order to leave comments, you need to log in
How to parse title from websites using python?
I'm new to python and can't seem to figure out how to implement the following task.
There is a txt file with domains (about 10,000 domains), saved in upper case. You need to:
- transfer domain addresses to lowercase
- add the string 'http://' at the beginning of the domain, so that the domain can then be inserted into requests
- make a loop so that the parser collects a title from each domain (site)
- write everything to a file a table with two fields | site url | website title |
Answer the question
In order to leave comments, you need to log in
1) You can convert a string to lowercase using the str.lower() string method
2) You can add it at the beginning of a string like this: link = r"https://" + link
3)
for link in links:
[some parsing link site]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question