파이썬에서 SyntaxError: invalid syntax가 발생했습니다. 파이썬으로 영어 단어를 검색하려고 하는데

조회수 1316회

error File "/home/testcode/tmp/main830.py", line 15 give ^ SyntaxError: invalid syntax

이렇게 뜨네요. 코드는 밑에와 같이 했구요.

url = 'http://dic.daum.net/search.do?q=' word = 'hate'

import requests from bs4 import BeautifulSoup

response = requests.get(url+word) plain_html = response.text html = BeautifulSoup(plain_html, 'html.parser')

eng_dictionary = html.find(attrs={'class':'card_word #word #eng'}) search_word_box = eng_dictionary.find(attrs={'class':'search_box #box'}) search_word = search_word_box.find(attrs = {'class':'txt_cleansch'}) give search_word = search_word_box.find(attrs = {'class':'txt_cleansch'}).get_text()

  • (•́ ✖ •̀)
    알 수 없는 사용자

1 답변

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

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

(ಠ_ಠ)
(ಠ‿ಠ)