파이썬에서 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()
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력