0

Thank you for your time to read this I wanted to know if there's any way that i can get a specific code from different links but they are all of the same domain i mean if i put many facebook pages links it gets all their names in a text file and each one in different line

  • can you provide some examples, it seems you want the sub domains of a domain. – manas dash Feb 03 '19 at 02:50
  • Ok here the exaple https://www.facebook.com/zuck in this link if you opened it you will see the name Mark Zuckerberg and if you opened this https://www.facebook.com/moskov You will see the name Dustin Moskovitz all i want is to program it to get the names from a list of links like this – Mohamed Nazem Feb 03 '19 at 03:02
  • consider using Facebook API, if you want real names from user link. – manas dash Feb 03 '19 at 03:05
  • No no the domain isn't facebook it's just an example all i want is to grab specific HTML line from different links and put each one on a line – Mohamed Nazem Feb 03 '19 at 03:09

1 Answers1

1

I think if i understood you need the user's name form the link.

facebook.com/zuck

acebook.com/moskov

You can track this and extract the pagetitle, this may not be accurate always.

>   <title id="pageTitle">Mark Zuckerberg</title>  
>   <title id="pageTitle">Dustin Moskovitz</title>

html2text is a Python script that converts a page of HTML into clean, easy-to-read plain ASCII text. Better yet, that ASCII also happens to be valid Markdown (a text-to-HTML format). https://github.com/Alir3z4/html2text

if you want to read from the url check the below explanations How to read html from a url in python 3

manas dash
  • 310
  • 1
  • 8