fleeksoft / ksoup

Ksoup is a Kotlin Multiplatform library for working with HTML and XML. It's a port of the renowned Java library Jsoup.
https://fleeksoft.github.io/ksoup/
Apache License 2.0
236 stars 9 forks source link

Allow us to add User-Agent to request header #27

Closed MahmoudMabrok closed 6 months ago

MahmoudMabrok commented 6 months ago

I want to get data from YouTube page and YouTube send different html content , so I need to simulate that a browser open the link.

I did not get a sample to how to use httpRequestBuilder

itboy87 commented 6 months ago

Please check https://ktor.io/docs/request.html#parameters

Ksoup.parseGetRequest("https://xxxxx.com", httpRequestBuilder = {
       headers {
           append("User-Agent", "XXXXXXX")
       }
})