【问题标题】:how to extract link from html file.(I am using python)如何从 html 文件中提取链接。(我正在使用 python)
【发布时间】:2021-03-18 07:21:48
【问题描述】:

起初很抱歉我的英语不好。

我正在尝试通过 python 抓取网络信息。

这是来自 html 的代码,我想只提取链接,除了链接旁边的文本。

<a href="https://www.mk.co.kr/news/culture/view/2021/03/258551/"">abcdefg~blahblahblah</a>

【问题讨论】:

标签: html python-3.x beautifulsoup


【解决方案1】:

有一个关于这个topic的问题 我还发现了这篇博文here

【讨论】:

    【解决方案2】:

    使用selenium,你可以locate element by xpath

    from selenium.webdriver.common.by import By
    
    driver.find_element(By.XPATH, '//meta[@name="url"]/@content')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-14
      • 2022-08-18
      相关资源
      最近更新 更多