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 773549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:58:59+00:00 2026-05-14T18:58:59+00:00

The webpage has the following source (only copied the important part): <h1>Relatórios</h1> <div id=textmenu>

  • 0

The webpage has the following source (only copied the important part):

<h1>Relatórios</h1>
<div id="textmenu">
   <a href="berichte.php" class="selected ">Tudo</a>
 | <a href="berichte.php?t=2">Comércio</a>
 | <a href="berichte.php?t=1">Reforços</a>
 | <a href="berichte.php?t=3">Ataques</a>

 | <a href="berichte.php?t=4">Outros</a>
</div>
<form method="post" action="berichte.php" name="msg">
<table cellpadding="1" cellspacing="1" id="overview"
    class="row_table_data">
    <thead>
        <tr>
            <th colspan="2">Assunto:</th>
            <th class="sent">
enviada</th>

        </tr>
    </thead><tfoot>
        <tr>            <th>&nbsp;</th>
            <th class=buttons><input name=del value=apagar              alt=apagar type=image id=btn_delete class=dynamic_img
                src=img/x.gif /></th>
                    <th class=navi>&laquo;<a href="berichte.php?s=10&amp;o=0">&raquo;</a></th>

        </tr>
    </tfoot>
    <tbody>

<tr>
            <td class="sel"><input class="check" type="checkbox" name="n1"
                value="15737030" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15737030">Rio Grande Do Leste ataca lcsanchez da aldeia</a> </div>
            </td>
            <td class="dat">hoje 21:33</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n2"
                value="15736877" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15736877">Rio Grande Do Leste ataca Thabiti da aldeia</a> </div>
            </td>
            <td class="dat">hoje 21:32</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n3"
                value="15736759" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15736759">Rio Grande Do Leste ataca Dionisio</a> </div>
            </td>
            <td class="dat">hoje 21:31</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n4"
                value="15736513" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15736513">Rio Grande Do Leste ataca Aldeia de troakris</a> (nova)</div>
            </td>
            <td class="dat">hoje 21:30</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n5"
                value="15736275" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15736275">Rio Grande Do Leste ataca Thabiti da aldeia</a> </div>
            </td>
            <td class="dat">hoje 21:28</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n6"
                value="15736220" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15736220">Rio Grande Do Leste ataca Aldeia de troakris</a> (nova)</div>
            </td>
            <td class="dat">hoje 21:28</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n7"
                value="15734824" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15734824">Rio Grande Do Leste ataca Austrália</a> </div>
            </td>
            <td class="dat">hoje 21:18</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n8"
                value="15734440" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15734440">Rio Grande Do Leste ataca andrômeda</a> (nova)</div>
            </td>
            <td class="dat">hoje 21:15</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n9"
                value="15730612" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15730612">Rio Grande Do Leste ataca wLG02 KING OF POP</a> (nova)</div>
            </td>
            <td class="dat">hoje 20:49</td>
        </tr>
        <tr>

            <td class="sel"><input class="check" type="checkbox" name="n10"
                value="15730304" /></td>
            <td class="sub"><img src="img/x.gif"
                class="iReport iReport1"
                alt="Ganhou como atacante sem perdas"
                title="Ganhou como atacante sem perdas" />
            <div><a href="berichte.php?id=15730304">Rio Grande Do Leste ataca wLG02 KING OF POP</a> (nova)</div>
            </td>
            <td class="dat">hoje 20:47</td>
        </tr>
        </tbody>

</table>
</form>

</div>

I want to read from the source and assign to a variable the values like:

relatorio[0] = berichte.php?id=15730304;

relatorio[1] = berichte.php?id=15730612;

...

relatorio[9] = berichte.php?id=15737030;

How to do that? thanks

  • 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-05-14T18:59:00+00:00Added an answer on May 14, 2026 at 6:59 pm

    using XPath or just a regex, I will update with some code in a moment.
    this is regex version, not depending in which element your href is.

    function getUrlArray(html) 
    {
        relatorio = [];
        var myregexp = /href="(berichte\.php\?id=[\d]+)/g;
        var match = myregexp.exec(html);
        while (match != null) {
            relatorio.push(match[1]);
            match = myregexp.exec(html);
        }
        return relatorio;
    }
    

    UPDATE

    You can use xhttprequest object to retrieve your page, here is sample

    if (window.XMLHttpRequest)     
    { 
        xhr = new XMLHttpRequest();     // Firefox
    } 
    else if (window.ActiveXObject)   // ActiveX
    {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");  // Internet Explorer 
    } 
    
    xhr.onreadystatechange = function() 
    {
        if (xhr.readyState == 4 && xhr.status == 200)
        {
             var myUrlArr = getUrlArray(xhr.responseText); 
             // At this point you have your array.
        }
    }
    
    xhr.open('GET', 'http://yourserver/page.html', true);                  
    xhr.send(null); 
    

    I haven’t tried but theoretically this should do the work.

    Details about Regex:

    This is Regular expressions used for matching in a string. It’s a small “language” where you describe the pattern and Regular Expression engine will try to match a text using that pattern. It can be used then in many programming languages (C/C++, PHP, Perl, Javascript) or text editing tools.

    In this simple regex I said

    Find anything that matches href=berichte\.php\?id= (slashes are to escape . and ?, because they are control symbols for regex) literally/as plain text/ then following [\d] (this is character class in square brackets [] and inside \d it says match a digit). Finally a + means one or many times and applies to last group, which is digit. the whole thing is enclosed in () which is capturing group. But you can also avoid it, by just replacing match[1] to match[0]. 0 element will always contain the whole match and the others are pointing to capturing groups if they are exist. You can have many capturing groups. It could have been useful if you wanted to capture only the id value, then you could just write like that

    /href="berichte\.php\?id=([\d]+)/g
    

    this will fill up match1 with id values.
    Sorry can’t explain you all regex here, but there are plenty of resources in google.

    Time

    var myregexp = /(berichte\.php\?id=[\d]+).+?<td class="dat">(.+?)</td>/g;
    

    Something like this. match[2] will contain pattern matching (.+?) which means anything with quantity one or more, lazy matching and located between <td class="dat"> and </td> literally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to extract from a webpage which has the following markup <div
I have the following set-up on my webpage <div id=clickable> <a href=hello.com>Here!</a> </div> Is
I'm creating a webpage which has several fields. I do not want the php
The web application has following prerequisites: Written in PHP Several menues, also a hierarchy
I need to scrape a simple webpage which has the following text: Value=29 Time=128769
There is a webpage which has a javascript method in the following format: window.usePlainText
I want to crawl/scrape a webpage which has a form to be precise following
I part of a webpage that should only be shown if javascript is enabled.
My webpage has a table where you can select different items. I want to
ActivePython webpage has a list of included things that includes something called OpenSSL version

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.