본문 바로가기 메뉴 바로가기

파이몬

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

파이몬

검색하기 폼
  • Pymon (15)
    • Programming (14)
      • Android (0)
      • Python (4)
      • Ubuntu (8)
      • Web (1)
      • Django (1)
    • 언어공부 (1)
      • 영어 (1)
  • 방명록

파이썬3 user-agent 변경하여 web 파싱하기

1. fake-useragent 설치pip install fake-useragent 2. fake-useragent 사용법from fake_useragent import UserAgent ua = UserAgent() print (ua.ie) # Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US); print (ua.msie) # Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)' print (ua['Internet Explorer']) # Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; G..

Programming/Python 2017. 4. 7. 09:56
python terminal color print

1. pip install termcolor 2. source from termcolor import colored, cprint print colored("ABCDEFG", "red") print colored("ABCDEFG", "green") print colored("ABCDEFG", "yellow") print colored("ABCDEFG", "blue") print colored("ABCDEFG", "grey") print colored("ABCDEFG", "magenta") print colored("ABCDEFG", "cyan") print colored("ABCDEFG", "white") cprint('Hello, World!', 'white', 'on_red') cprint('Hell..

Programming/Python 2017. 4. 4. 11:32
파이썬3 네이버 환율 정보 파싱

1. python3 소스 코드#_*_ coding:utf8 _*_ import urllib.request from bs4 import BeautifulSoup fp = urllib.request.urlopen('http://info.finance.naver.com/marketindex/exchangeList.nhn') source = fp.read() fp.close() class_list = ["tit","sale"] soup = BeautifulSoup(source,'html.parser') soup = soup.find_all("td", class_ = class_list) money_data={} for data in soup: if soup.index(data)%2==0: data=data.ge..

Programming/Python 2017. 4. 3. 11:31
이전 1 2 3 4 5 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • python3 환율 api
  • 파이썬 user-agent
  • 뉴스기사번역
  • python3
  • python3 파싱
  • 우분투
  • docker 설치
  • 도커 설치
  • python
  • tar 압축
  • 우분트 프로세스 백그라운드
  • 파이썬 웹파싱
  • 파이썬
  • 우분투 tar
  • multiprocess
  • 도커 사용법
  • multiprocessing
  • python web framework
  • 파이썬 병렬
  • 파이썬3 크롤러
  • python color print
  • python multiprocess
  • terminal print color
  • python3 환율
  • termcolor
  • python queue
  • apt-get error
  • 파이썬 파싱
  • python thread
  • docker 사용법
more
«   2025/12   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바