SyntaxError: invalid syntax occurred on Python. I'm going to search for English words on Python

Asked 2 years ago, Updated 2 years ago, 22 views

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

It comes up like this. The chords are as follows.

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()

python

2022-09-22 20:05

1 Answers

Did you install beautiful soup?


2022-09-22 20:05

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.