How to add Jsoup to my Android Studio project?
21,945
Solution 1
Gradle (build.gradle) in your app folder. put under dependencies section. clean and rebuild project
// jsoup HTML parser library @ https://jsoup.org/
implementation 'org.jsoup:jsoup:1.10.3'
Solution 2
You should add your dependencies in your build.gradle file. Please check the screenshot attached.
Author by
user1788736
Updated on January 05, 2020Comments
-
user1788736 over 4 years
I am trying to use jsoup in my android studio project but i keep getting this error: Error:(10, 16) Gradle: error: package org.jsoup does not exist.
Could you guys tell me the steps on how to add jsoup library to my project? Thanks in advance.
Edit: For learning purpuse i am running the java code alone without main activity!
code:
package com.jsoupTest.jsoupTest; import java.io.IOException; import org.jsoup.Connection; import org.jsoup.Jsoup; import org.jsoup.UnsupportedMimeTypeException; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.io.IOException; public class JsoupGetRequest { public static void main(String[] args) throws IOException { String dc=Jsoup.connect("http://somelink.com").timeout(6000).get(); System.out.println(dc); } }