I used
"<a href='/property-(.+?)-wa[a-zA-Z0-9-\s\" ]{5,50}><img src="
to get the type of property in webpage that I want to analyze
and I can get these message by using regex to analyze code like this:
<a href="/property-house-wa-joondalup-405127028" ><img src=
It is
"<a href='/property-
+ house(what I want)+-wa
+ 5-50 chars,numbers,",space +><img src=
I tested it in visualization tool and it seems to be OK
But the output is empty when running code
code:
from urllib.request import urlopen
import re
url='https://www.realestate.com.au/rent/in-perth+-+greater+region,+wa/list-1'
page = urlopen(url).read().decode('utf-8')
##print(page)
propertyReg=re.compile(r"<a href='/property-(.+?)-wa[a-zA-Z0-9-\s\" ]{5,50}><img src=")
propertytext=re.findall(propertyReg,page)
print(propertytext)