html解析コードを書いたのですがエラーがでます。
python
1import requests 2from bs4 import BeautifulSoup 3 4url = "http://www.flower-ldh.jp" 5response = requests.get("url") 6response.encoding = response.apparent_encoding 7 8bs = BeautifulSoup(response.text, 'html.parser') 9 10ul_tag = bs.find("ul") 11 12for a_tag in ul_tag.find_all('a'): 13 14 text = a_tag.text 15 link_url = a_tag('href') 16 print('{}: {}'.format(text, link_url))
MissingSchema: Invalid URL 'url': No schema supplied. Perhaps you meant http://url?
分かる方よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。