1. 스튜디오 코드 터미널에서 selenium과 beautifulsoup를 설치한다.
selenium 설치 -> pip install selenium
beautifulsoup 설치 -> pip install beautifulsoup4

+나는 selenium 설치를 할때

버전이 다르다는 경고가 떠서 python -m pip install --upgrade pip 이렇게 버전을 업그레이드 해줬다.

한 번 설치하고 나면 그 후에 똑같은 명령어를 쳤을 때 이렇게 나올거다. (아마도,,,?)

baserUrl은 https://www.instagram.com/explore/tags/%EC%95%84%EC%9D%B4%EC%9C%A0/
여기서 https://www.instagram.com/explore/tags/ 이부분이 baseUrl임
%EC%95%84%EC%9D%B4%EC%9C%A0 원래 여기는 아이유임.
아이유가 아스키코드로 변환된것 그 전까지의 코드는 변하지 않음.
plusUrl 은 input으로 받아서 항상 원하는 내용 검색 가능하게
url = baseUrl + plusUrl 이렇게 그냥 더하면 한글로 '아이유'라고 검색을 해도 아스키코드로 변환안되고 그냥 아이유로 들어감
그것을 방지하기 위해서 quote_plus을 사용
from urllib.request import urlopen
from urllib.parse import quote_plus
from bs4 import BeautifulSoup
from selenium import webdriver
import time
baseUrl = 'https://www.instagram.com/explore/tags/'
plusUrl = input('검색할 태그를 입력하세요 : ')
url = baseUrl + quote_plus(plusUrl)
print(url)

링크 따라가면 잘 이동함
'Tools > RPA' 카테고리의 다른 글
| [UiPath] Activity - if, switch, Flow Decision,While, Do While, Parallel, Pick / PickBranch (0) | 2021.07.03 |
|---|---|
| [Uipath] Activity - Click, GetText, SetText, SendHotKey, InputDialog (0) | 2021.07.02 |
| [UiPath] 변수와 자료형 (0) | 2021.07.02 |
| [UiPath] Hello World 출력 (0) | 2021.07.02 |
| [UiPath] 팝업창 닫고 로그인 후 목차로 이동 (0) | 2021.06.30 |