import pywikibot
import requests
from pywikibot import pagegenerators as pg

baseURL='https://www.scopus.com/authid/detail.uri?authorId='

def getEmail(text):
    start=text.find('name="emailAddress" value="')
    end=text[start+27:].find('"/>')
    if (start>0) and (end>0):
      return(text[start+27:start+end+27])
    return('')
    
def getOtherNames(text):
    start=text.find('<tr data-reportRenderTime=\'pcr\'>')
    end=text[start:].find('</tr>')
    work=text[start+34:start+end]
    print(f'1)|{len(work)}\n|{work}')
    start=work.find('<span class="badges"')
    work=work[start+19:]
    print(f'2)|{len(work)}\n|{work}')
    while (start>0) and (end>0):
        end=work[start:].find('</span>')
        print(f'3)\n {start}\n|{end}\n|{work[start+21:start+21+end]}\n\n')
        work=work[end:]
        start=work.find('<span class="badges"')
    
def getSCOPUS(id):
    f = requests.get(baseURL+id) 
    #email=getEmail(f.text)
    #print(email)
    getOtherNames(f.text)
    
#getSCOPUS('8042670300') 
getSCOPUS('7007006983')
1)|549
</td>
2)|350
</td>
3)
 180
|18
<span class="


3)
 6
|39
<span class="


3)
 14
|40
<span class="


3)
 22
|32
<span class="


3)
 30
|39
<span class="


3)
 38
|32
<span class="


3)
 6
|32
<span class="


3)
 14
|36
<span class="


3)
 22
|39
</td>