cantino / ruby-readability

Port of arc90's readability project to Ruby
Apache License 2.0
919 stars 170 forks source link

'403 Forbidden' got when reading a page #58

Closed theSalt closed 10 years ago

theSalt commented 10 years ago

I wanna get the content of web page 'http://blog.csdn.net/luoshengyang/article/details/17131835', but '403 forbidden' is returned

1.9.3p374 :010 > source = open('http://blog.csdn.net/luoshengyang/article/details/17131835').read
OpenURI::HTTPError: 403 Forbidden
ghost commented 10 years ago

It may not like the user agent being sent by ruby-readability. Try using Net::HTTP instead of OpenURI and specify a real user-agent.

On Sun, Dec 8, 2013 at 7:02 PM, theSaltName notifications@github.comwrote:

I wanna get the content of web page ' http://blog.csdn.net/luoshengyang/article/details/17131835', but '403 forbidden' is returned

1.9.3p374 :010 > source = open('http://blog.csdn.net/luoshengyang/article/details/17131835').read OpenURI::HTTPError: 403 Forbidden

— Reply to this email directly or view it on GitHubhttps://github.com/cantino/ruby-readability/issues/58 .

Iteration Labs, LLC Andrew Cantino Founder / CEO