現在、正規表現で特定要素を抜き出すコードを勉強しております。
BeatifulSoupを利用し、サイトから特定文字を抜きます。
#(ライブラリ読み込みは省いてます) soup = BeautifulSoup(r.content, 'html.parser', from_encoding=content_type_encoding) trs = soup.find_all("tr") for i in range(len(trs)): url = trs[i].find(text=re.compile("http")("ホーム"))
エラー Traceback (most recent call last): File "<stdin>", line 2, in <module> TypeError: '_sre.SRE_Pattern' object is not callable
上記のように、("http")("ホーム")どちらも含む要素を抜き出すというようなことをシたいのですが
正規表現での正しい記述をご教示いただけないでしょうか。
宜しくお願い致します。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。