0

Can anybody explain to me why a site gives File not found - 404 through Android Google Chrome but works with browser in PC.

What I am trying to do is to get the RSS feed into my Android code but realized this problem that it doesn't even work to access with Androids web browser after I tried Jsoup etc. which all gives File not found - 404.

Is there any workaround?

Sufiyan Ghori
  • 18,164
  • 14
  • 82
  • 110
frizzles
  • 13
  • 2
  • can you please show your code and complete error ? – Sufiyan Ghori Dec 24 '14 at 20:02
  • It's not about the code at this moment. I am trying to access the webiste from my Chrome browser in Android and get "File not found" but when I go to same website from PC it works. – frizzles Dec 24 '14 at 20:45

1 Answers1

0

This is because the Chrome browser in your phone redirects this url to the mobile website, i.e http://m.expressen.se/rss/sport, which doesn't exist.

Before opening this webpage, go to settings in your Chrome and choose "Request desktop site" and then open the url, it will work fine then (I have tested it myself)

If you want to request Deaktop site in webview then you may need to change the user agent. please read this, Setting WebView to view Desktop Site and Not Mobile Site

Community
  • 1
  • 1
Sufiyan Ghori
  • 18,164
  • 14
  • 82
  • 110
  • Alright! Now the next question is how I can do that in code the best way? Maybe customize user-agent in jsoup or is it possible to do this with some standard java code? EDIT: Still getting redirected to failover.expressen.se when using "Request desktop site". I want to get the RSS feed in xml-format as in http://expressen.se/rss/nyheter – frizzles Dec 24 '14 at 21:02
  • first request desktop site and then visit the url, you may be visiting the site first and then requesting the desktop site. Read the updated answer on how to do it in webView. – Sufiyan Ghori Dec 24 '14 at 21:10