teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

修正

2020/06/02 09:19

投稿

ForestSeo
ForestSeo

スコア2724

answer CHANGED
@@ -1,5 +1,6 @@
1
1
  ```Python
2
+ lst = []
2
- soup.find_all('div', attrs = {'class': 'Horse02'}).find_all('a', attrs = {'href': re.compile('^/horse')})
3
+ for item in soup.find_all('div', attrs = {'class': 'Horse02'}):
3
-
4
- soup.find_all('div', attrs = {'class': 'Horse02'}).find('a', attrs = {'href': re.compile('^/horse')})
4
+ lst.append(item.find('a', attrs = {'href': re.compile('^/horse')}))
5
+ print(lst)
5
6
  ```でいけますか?