i am working on web scraping using beautifulsoup and trying to get links in a html page for given list of urls.
suppose if i want to get facebook and twitter links in a page, I tried
urls_list = ['www.facebook.com','www.apps.facebook.com', 'www.twitter.com']
reg = re.compile(i for i in urls_list)
print soup('a',{'href':reg})
and
soup = BeautifulSoup(html_source)
reg = re.compile(r"(http|https)://(www.[apps.]facebook|twitter).com/\w+")
print soup('a',{'href':reg})
above code is not working and retrieving all urls in a page. please bear with my little knowledge in regex and python