Code:
import org.jsoup.Jsoup
fun main(){
val url = "https://www.google.com/maps/place/?q=place_id:"
//val placeID:String = "ChIJRVY_etDX3IARGYLVpoq7f68";
val placeID:String = "ChIJ1zoUGxYE9YgRL399jlxWp6Q";
val doc = Jsoup.connect(url+placeID).get()
val text = doc.html()
//println(text)
when (text)
{
is String -> println("yay");
}
//val pID: Collection<String>? = placeID as? String
//val here: Pair<Int, String>? = text.findLastAnyOf(placeID,0,false);
var tempLine:String = ""
tempLine = text.substringAfterLast(placeID)
val newLength = tempLine.length
var tempLine2 = tempLine.substringBefore("window.APP_FLAGS")
println(tempLine2)
}
The text I want to specifically grab and return
I am working on a personal side project and I have hit a wall, where I cannot grab the busy time information from Google's page, this location is Trader Joes.