Requests2 python 7일차 웹 스크래핑 / beautifulsoup 4 / find / find_all / requests / response status_code # 5.0 웹 스크래핑 # beautiful soup (웹사이트의 데이터를 받아올 수 있게 해주는 python 라이블러리) # 5.1 다운로드 # $ pip install beautifulsoup4 # https://www.crummy.com/software/BeautifulSoup/bs4/doc/#quick-start # 5.2 주의사항 # 웹스크래핑으로 상업적 이용시 주의해야한다. from requests import get from bs4 import BeautifulSoup base_url ="https://weworkremotely.com/remote-jobs/search?term=" search_term ="vue" reseponse = get(f"{base_url}{search_term}").. 2023. 1. 10. python 6일차 / for ~ in ~ / for loop / requests / status_code # 4.5 For Loops websites = ( "google.com", "airbnb.com", "https://twitter.com", "facebook.com", "https://tictoc.com" ) websites[0] # tuple 의 갯수만큼 반복 for website in websites: print("Hello", website) # 일반적으로 tuple이나 list를 만들 때 복수형으로 만든다 # websites, movies, users, photos ,... # for 에서는 단수형으로 쓴다. # website, movie, user, photo # 4.6 URL Formatting for website in websites: if not website.startswith("h.. 2023. 1. 6. 이전 1 다음 반응형