1

Serel and pilha are good Ruby wrappers for the StackExchange API, but I am not able to access the body method for question and answers. The body method returns nil.

I want the content of questions and answers. How can I get them?

Also I have used Nokogiri to extract content, but sometimes I get an "internal error 500". Why is this so? Do they block the scraper #Nokogiri after some attempts?

1
  • For the record, Nokogiri isn't a scraper, it's an XML/HTML parser. Commented Jun 26, 2013 at 23:34

1 Answer 1

2

Although I don't use Ruby (and consequently have not used the two libraries you've mentioned), I'm going to guess that the problem is that you aren't specifying a filter that includes body.

By default, post body is not included in the JSON returned by API methods and must explicitly be requested by creating a filter that includes it. The withbody filter, for example, would include body in the response.

You will likely want to consult the documentation for each library for instructions on setting a filter.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.