uninitialized constant HTMLTree (NameError)

V

Vikash Kumar

I am working on windows environment, in my code I am using,

require 'http-access2'

client = HTTPAccess2::Client.new
url="http://www.elliottbaybook.com/..."
parser = HTMLTree::XMLParser.new(false,false)
parser.feed(client.getContent(url))
xml=parser.document



When I run the code it gives the following error message:

uninitialized constant HTMLTree (NameError)
 
P

Phrogz

Vikash said:
I am working on windows environment, in my code I am using,

require 'http-access2'

uninitialized constant HTMLTree (NameError)

You need to require the library with HTMLTree in it.

require 'html/tree'
 
V

Vikash Kumar

Vikash said:
I am working on windows environment, in my code I am using,

require 'http-access2'

client = HTTPAccess2::Client.new
url="http://www.elliottbaybook.com/..."
parser = HTMLTree::XMLParser.new(false,false)
parser.feed(client.getContent(url))
xml=parser.document



When I run the code it gives the following error message:

uninitialized constant HTMLTree (NameError)



The above error is resolved by adding require 'html/tree', but a new
error is coming

uninitialized constant HTMLTree::XMLParser (NameError)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top