Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7904907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:16:29+00:00 2026-06-03T10:16:29+00:00

hello Currently i am able to parse the xml file if it is saved

  • 0

hello Currently i am able to parse the xml file if it is saved in my folder from the webpage.

use strict;
use warnings;
use Data::Dumper;
use XML::Simple;

my $parser = new XML::Simple;
my $data = $parser->XMLin("config.xml");
print Dumper($data);

But it does not work if i am trying to parse it from the website.

use strict;
use warnings;
use Data::Dumper;
use XML::Simple;

my $parser = new XML::Simple;
my $data = $parser->XMLin("http://website/computers/computers_main/config.xml");
print Dumper($data);

it gives me following error “File does not exist: http://website/computers/computers_main/config.xml at test.pl line 12″

How do I parse multiple xml files from the webpage? i have to grab multiple xml form the websites and parse it. can someone please help me with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:16:31+00:00Added an answer on June 3, 2026 at 10:16 am

    Super Edit: This method will require WWW::Mechanize but it will allow you to login to your website then get the xml page. You will have to change a few things which are found in the comments. Hope this helps.

    use strict;
    use warnings;
    use Data::Dumper;
    use XML::Simple;
    use WWW::Mechanize;
    
    # Create a new instance of Mechanize
    $bot = WWW::Mechanize->new();
    # Create a cookie jar for the login credentials
    $bot->cookie_jar(
            HTTP::Cookies->new(
                file           => "cookies.txt",
                autosave       => 1,
                ignore_discard => 1,
        )
    );
    # Connect to the login page
    $response = $bot->get( 'http://www.thePageYouLoginTo.com' );
    # Get the login form
    $bot->form_number(1);
    # Enter the login credentials.
    # You're going to have to change the login and 
    # pass(on the left) to match with the name of the form you're logging
    # into(Found in the source of the website). Then you can put your 
    # respective credentials on the right.
    $bot->field( login => 'thisIsWhereYourLoginInfoGoes' );
    $bot->field( pass => 'thisIsWhereYourPasswordInfoGoes' );
    $response =$bot->click();
    # Get the xml page
    $response = $bot->get( 'http://website/computers/computers_main/config.xml' );
    my $content = $response->decoded_content();
    my $parser = new XML::Simple;
    my $data = $parser->XMLin($content);
    print Dumper($data);
    

    Give this a go. Uses LWP::Simple as answered above. It just connects to the page and grabs the content of that page (xml file) and runs in through XMLin.
    Edit: added simple error checking at the get $url line.
    Edit2: Keeping the code here because it should work if a login is not required.

    use strict;
    use warnings;
    use Data::Dumper;
    use XML::Simple;
    use LWP::Simple;
    
    my $parser = new XML::Simple;
    
    my $url = 'http://website/computers/computers_main/config.xml';
    my $content = get $url or die "Unable to get $url\n";
    my $data = $parser->XMLin($content);
    
    print Dumper($data);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my XML File: <Applications> <Application Name=Abc> <Section Name=xyz> <Template Name=hello> ... .... </Template>
Hello i made a php socket server to get data from plc, plc is
I want to write to a file from my filter and then be able
Hello Im currently writing a product syncronisation script for magento. I know how to
Hello I currently have this code checking if a cookie exists, it works all
Hello I'm currently on Day 2 of Jeffrey Way's Codeigniter tutorial. In this screencast
Hello everyone I'm currently having 2 issues with the code below: Upon return of
Hello my friend is currently development an application using SOA Architecture, He sent me
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
Currently I am doing this: I have text that looks like: Hello ${user.name}, this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.