python - 使用 chaquopy 将 BeautifulSoup 实现到 Android Studio

标签 python android beautifulsoup chaquopy

我目前正在使用 Android Studio 和 BeautifulSoup 制作一个网络抓取应用程序。我如何实现

from bs4 import BeautifulSoup

像在 Python 中一样进入 Android Studio?

我的build.gradle是

python {
        buildPython "C:/Python38/python.exe"
        pip{
            install "bs4"
            install "beautifulsoup4"
            install "requests"
        }
    }

我在 Python 中的导入是

from bs4 import BeautifulSoup
import requests

最佳答案

而不是使用

soup = BeautifulSoup(html_text, 'lxml')

我用过

soup = BeautifulSoup(html_text, 'html.parser')

在 Python 文件中,它似乎完成了这项工作。

关于python - 使用 chaquopy 将 BeautifulSoup 实现到 Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70210209/

相关文章:

python - 从时间中减去小时和分钟

python - 使用 Python 从包含给定字符串的 FTP 服务器下载文件

python - 在 WebDriver 中加载 Firefox 扩展时权限被拒绝

python - 模拟基类的方法

python - BeautifulSoup 能否保留 CDATA 部分?

android - 我在哪里可以找到 Android 源 jar?

android - 动态壁纸中的动态文本

安卓 : Creating a full screen translucent overlay with z-order

selenium - 从无限滚动网站抓取内容

python - BeautifulSoup 网络爬虫问题 : can't find certain divs/tables