estoy intendo extraer una URL de un pagina web, utilizando BeautifulSoup y python, y hasta hora solo he podido extraer el que contiene la URL, pero no puedo filtrar mas de ese punto, para solo ver la URL, este es mi codigo:
import requests
import urllib.request
from bs4 import BeautifulSoup
url = 'https://www.paginaweb/discover/detail?titleNo=165516&articleNo=20'
r = requests.get(url)
html_content = r.text
soup = BeautifulSoup(html_content,"html.parser")
print(soup.find_all('script'))
con una salida como esta:
[<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>, <script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-122461178-1"></script>, <script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-122461178-1');
</script>, <script>
/*<![CDATA[*/
var lcs = {
TID: '165516',
ArID:'4',
AtID:"na",
UID:"na",
DID:'pc'
};
/*]]>*/
</script>, <script>
/*<![CDATA[*/
var cmnData = {
titleNo: 165516,
articleNo: 4,
api: {
articleCmtWrite: 'https://www.paginaweb.com/api/comments/write',
articleCmtListView: 'https://www.paginaweb.com/api/comments/get',
articleCmtReport: 'https://www.paginaweb.com/comment/report?commentNo=',
delArticleCmtList: 'https://www.paginaweb.com/api/comments/delete',
addGood: 'https://www.paginaweb.com/api/comments/good',
fun: 'https://www.paginaweb.com/api/articleGood'
},
status: {
comment: '',
fun: 0
},
user: {
},
comicData: [
'https://images.paginaweb.com/legacy/article/1/3/b/13biajhd9e47N7.JPEG/dims/optimize?expiration=1576283957&token=fa2cbe19fbac47143e77cf107a64d77ca3e0a2b8d0d7f3b6e522043bccabd786',
]
};
/*]]>*/
</script>, <script src="https://resources.paginaweb.com/js/articleDetailApp/app.1.0.0.min.js"></script>]
Y esta seria la URL que me gustaria extraer, casi en el final del codigo:
comicData: [
'https://images.paginaweb.com/legacy/article/1/3/b/13biajhd9e47N7.JPEG/dims/optimize?expiration=1576283957&token=fa2cbe19fbac47143e77cf107a64d77ca3e0a2b8d0d7f3b6e522043bccabd786',
Alguna idea o guia para poder hacerlo?, que consten que soy muy nuevo en python y casi todo el codigo son trozos de otros scrips.