서브라임텍스트3 에서 파이썬 3

조회수 1493회

기존에 EditPlus 를 사용하여 Python3 를 코딩하였습니다.

허나 sublime text 3 로 갈아타면서 기존에 사용하던 간단한 크롤러를 실행하였는데 정상적으로 작동을 하지 않고 있습니다.

코드상에 오류는 없습니다.

EditPlus 로 빌드하였을때 정상적으로 크롬드라이버에서 원격으로 작동되어집니다.

하지만 서브라임텍스트에서만 오류가 납니다.

혹시 sublime text 3에서 크롬드라이버를 사용하시는 분들 계시면 도움 부탁드립니다.

//import requests
from bs4 import BeautifulSoup
import pymysql
from  selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import getpass
import urllib.request
# [] #

username = input("Input ID : ")# User ID
password = input("Input PWD : ")# User PWD
hashTag = input("Input HashTag : ")# Search #

checkTag = hashTag.find('#')

# [ HASHTAG USING CHECK ] #

if checkTag==-1:
    hashTag = '#'+hashTag

driver = webdriver.Chrome("C:/Users/LEEJIYONG/Desktop/crawling/chromedriver.exe")# Chromedriver PATH
driver.get("https://www.instagram.com/accounts/login/")

# [ LOGIN ] #

element_id = driver.find_element_by_name("username")
element_id.send_keys(username)
element_password = driver.find_element_by_name("password")
element_password.send_keys(password)

password = 0 #RESET Password

driver.find_element_by_xpath("""//*[@id="react-root"]/section/main/div/article/div/div[1]/div/form/div[1]/div/input""").submit()
driver.implicitly_wait(5)

이런 에러가 발생합니다.

//Traceback (most recent call last):
  File "sub_test.py", line 22, in <module>
    driver = webdriver.Chrome("C:/Users/LEEJIYONG/Desktop/crawling/chromedriver.exe")# Chromedriver PATH
  File "C:\Users\LEEJIYONG\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "C:\Users\LEEJIYONG\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 151, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Users\LEEJIYONG\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 240, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\LEEJIYONG\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 308, in execute
    self.error_handler.check_response(response)
  File "C:\Users\LEEJIYONG\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86_64)
  • (•́ ✖ •̀)
    알 수 없는 사용자

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)