Sunday, August 30, 2020

How to get programmer's email from GitHub

How to get programmer's email from GitHub

The source code

import requests

import re

import time

from bs4 import BeautifulSoup


# Hello everyone today I want to show how to get programmer's email from GitHub

f = input('Search: ') # the search word   

url = 'https://github.com/search?q=%s&type=Users&p=' %f 

for page in range(10): # The number of pages is 10 and you can change it

 

    r = requests.get(url + str(page))

    

    soup = BeautifulSoup(r.content, "html.parser")

    

    gh = soup.findAll('a', {'class':'muted-link'})

    for h in gh:

        

        print(h.text) #Print the programmer's email