I am trying to search whole word pid in the link but somewhat this is also searching for id in this code
for a in self.soup.find_all(href=True):
if 'pid' in a['href']:
href = a['href']
if not href or len(href) <= 1:
continue
elif 'javascript:' in href.lower():
continue
else:
href = href.strip()
if href[0] == '/':
href = (domain_link + href).strip()
elif href[:4] == 'http':
href = href.strip()
elif href[0] != '/' and href[:4] != 'http':
href = ( domain_link + '/' + href ).strip()
if '#' in href:
indx = href.index('#')
href = href[:indx].strip()
if href in links:
continue
links.append(self.re_encode(href))