BeautifulSoup - extracting attribute values

后端 未结 2 1361
一整个雨季
一整个雨季 2020-11-29 12:12

If Beautiful Soup gives me an anchor tag like this:


How would I

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 12:57

    If you already have the anchor, grab the href attribute like this:

    href = anchor["href"]
    

提交回复
热议问题