Implementing BeautifulSoup to Android Studio with chaquopy

Viewed 161

I'm currently making a web scraping app using Android Studio with BeautifulSoup. How do I implement

from bs4 import BeautifulSoup

into Android Studio as I would in Python?

My build.gradle is

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

and my imports in Python is

from bs4 import BeautifulSoup
import requests
1 Answers

Instead of using

soup = BeautifulSoup(html_text, 'lxml')

I used

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

in the Python file and it seemed to do the job.

Related