Closed orelvis15 closed 1 month ago
Hi,
the parser is not working because the website is not returning the feed but an error page because it blocks "non-browser" user agents.
You can resolve that by customizing the User-Agent
and passing the same User-Agent
that the browser uses
val rssParser = RssParserBuilder(
OkHttpClient.Builder()
.addNetworkInterceptor { chain ->
chain.proceed(
chain.request()
.newBuilder()
.header(
"User-Agent",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
)
.build()
)
}
.build()
).build()
Closing because it's not a bug.
I'm trying to parse this feed https://cu.usembassy.gov/es/feed/ but it's giving me this error. I was looking for some error in the xml but I can't find it.