Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import requests
- from bs4 import BeautifulSoup
- raw = requests.get('https://www.yellowpages.my/listing/results.php?keyword=boutique&where=selangor&screen=1').text
- raw = raw.replace("</br>", "")
- soup = BeautifulSoup(raw, 'html.parser')
- phone = [re.findall('\\>.*?<',d.find('span')['data-content'])[0][1:][:-1] for d in soup.find_all('div',{'class':'cbp-vm-cta'})]
- print(phone)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement