Beautifulsoup

Programming/Python 웹 스크래퍼 만들기

Python Keyword Arguments

5.5 Keyword Arguments 이전에 beautifulsoup 를 사용해서 class_ = "jobs" 에 해당하는 웹사이트 HTML 코드를 가져왔었다. from requests import get from bs4 import BeautifulSoup base_url = "https://weworkremotely.com/remote-jobs/search?utf8=%E2%9C%93&term=" search_term = "python" response = get(f'{base_url}{search_term}') if response.status_code != 200: print("Can't request website") else: soup = BeautifulSoup(response.text,'h..

Programming/Python 웹 스크래퍼 만들기

Python BeautifulSoup

5.4 BeautifulSoup 아래 코드로 weworkremotely 웹사이트의 python 구인정보를 가져왔다. from requests import get base_url = "https://weworkremotely.com/remote-jobs/search?utf8=%E2%9C%93&term=" search_term = "python" response = get(f'{base_url}{search_term}') if response.status_code != 200: print("Can't request website") else: print(response.text) jobs 라는 class 를 가진 section 을 찾아 추출한다. 그리고 section 에 있는 ul 안에서 모든 li 를 찾는..

Programming/Python 웹 스크래퍼 만들기

Python WebScrapper Introduction

5.1 Introduction 웹 스크래핑은 user가 쓴 코드가 웹사이트에 들어가서 데이터를 추출해내는 것이다. indeed.com ( 구인구직 사이트 ) 에서 검색할 수 있는 모든 프로그래밍 관련 일들의 데이터를 가져온다. 혹은 weworkremotely.com 에서 데이터를 가져올수도 있다. 그리고 이 모든 데이터들을 하나의 엑셀 파일에다 정리할수 도 있다. 웹 스크래핑을 통해 여러가지 정보를 수집할 수 있는데, 예를 들어 어떤 회사에 대한 기사들을 투자 정보를 얻기 위해 여러 웹사이트에서 가져올 수 도 있으며, 같은 제품을 판매하는 여러 웹사이트의 가격들 데이터를 수집하여 제일 싸게 구매 할 수 있는 곳을 선별할 수 도 있다. Python 과 Beautifulsoup 를 통해서 웹 스크래퍼를 제작..