# importing package
from selenium import webdriver
# setting the path
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
options = webdriver.ChromeOptions
options.headless = True
driver.get("https://www.craispesaonline.it/provincia/treviso")
# x path for Address and Postal Code
x = ('//address//p[@class="text-lowercase m-0 ng-binding"]')
search = driver.find_elements_by_xpath(x)
# retrieving the output in a text file
with open("Italy_Scrape.txt", "a") as f:
for i in search:
print("PostalCode :" + i.text, file=f)
print("----------------------------------------------------------------------------", file=f)
driver.quit()
CODE TO GET THE POSTAL ADDRESS. In the above code, I am using selenium which chrome headless. Need the code to get the postal code only for stores for which delivery is available.