So I was learning to write a really simple web scraping project, everything was okay until what I expected to see didn't show up, but exit code 0 so I assumed nothing went wrong with the code. Can anyone help me to see what's going wrong?
import requests
from bs4 import BeautifulSoup
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15"}
res = requests.get('http://bj.xiaozhu.com/', headers=headers) #get method of appending the request header
soup = BeautifulSoup(res.text, 'html.parser')
prices = soup.select('#page_list > ul > li > div.result_btm_con.lodgeunitname > span.result_price > I') #selector path of the prices
for price in prices:
print(price.get_text())
The output is supposed to print a list of prices from the website that I've scraped from, but instead Pycharm returned Process finished with exit code 0.