Pythonを学習している初学者です。
特定のサイトからURLを抽出したものをLINEに送るようにしたのですが複数のURLをlineに送った後、下記画像の赤枠を押したあと
右の画像のような表示のされ方になってしまい開けなくなっています。
完成図としては複数のURLを下記画像の黄色枠のようにリンクと画像が一緒にでてくるようにしたいのですがどのようにすればよいでしょうか?
ご教示いただけると幸いです。
results = [] shoes_url=[] for idx, detail_url in enumerate(items_df.url.head(3)): detail_res = get_html(detail_url) detail_sp = bs(detail_res.content, "html.parser") results.append(detail_sp) shows.append(detail_url) print(f"now {idx} of numbers" ) print(detail_res) print(detail_url) time.sleep(5) #実行結果------------------------------------ now 0 of numbers <Response [200]> https://www.mercari.com/jp/items/m67414320339/ now 1 of numbers <Response [200]> https://www.mercari.com/jp/items/m75949025043/ now 2 of numbers <Response [200]> https://www.mercari.com/jp/items/m36121631279/ ------------------------------------------------ last_result = [] for detail_sp in results: detail_result = detail(detail_sp) last_result.append(detail_result) detail_df = pd.DataFrame(last_result) for c in detail_df.columns: detail_df[c] = detail_df[c].str.replace(",", "") detail_df.to_csv("mercari.csv",index=False,encoding='utf_8_sig') TOKEN='************************************' API_URL='https://notify-api.line.me/api/notify' send_contents=shoes_url TOKEN_dic={'Authorization':'Bearer'+' '+TOKEN} send_dic={'message':send_contents} print(TOKEN_dic) print(send_dic) #実行結果------------------------------------------------------------ {'Authorization': '******************************'} {'message': ['https://www.mercari.com/jp/items/m67414320339/', 'https://www.mercari.com/jp/items/m75949025043/', 'https://www.mercari.com/jp/items/m62075310899/']} --------------------------------------------------------------------- requests.post(API_URL,headers=TOKEN_dic,data=send_dic)
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/08/19 07:18
2021/08/19 07:25
2021/08/19 07:28
2021/08/19 07:33
2021/08/19 08:37
2021/08/20 02:09