Jump to content

twittoris

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by twittoris

  1. or something like this? // Get rows from tables $rows = $tables->item(0)->getElementsByTagName('tr'); // Loop over each row foreach ($rows as $row) { Get each column by tag name $cols = $row->getElementsByTagName('td'); Echo values (here you can assign them in array for example) echo $cols->item(0)->nodeValue.'<br />'; echo '<hr />'; i need help
  2. I am thinking something like this. // Create DOMDocument $dom = new DOMDocument(); // Load html string $dom->loadHTML($html2); // Find all links foreach($html2->find('table.tblAddr') as $element) echo $element->table.tblAddr . '<br>';
  3. I have a table like this: http://empirebuildingsestate.com/company.html How can I separate the table values into variables so I can insert them into my mySQL database? I have been trying DOMDocument but i need some help.
  4. Also how would i also be able to add this table to an array. </tr> <tr> <td headers="c1"> C/O ELECTRONICS INC.<br> 2390 PARK ROW<br> NEW YORK, NEW YORK, 15538 </td> </tr> <tr> <th scope="col" id="c4" class="leftalign">Registered Agent</th> </tr> <tr> <td headers="c1"> NONE </td> </tr> </table>
  5. This code outputs the table fields. how do I set them into an array and assign then to a variable to be inserted into a mysql database. // Load html string $dom->loadHTML($html2); // Get tables from html $tables = $dom->getElementsByTagName('table'); // Get rows from tables $rows = $tables->item(0)->getElementsByTagName('tr'); // Loop over each row foreach ($rows as $row) { // Get each column by tag name $cols = $row->getElementsByTagName('td'); // Echo values (here you can assign them in array for example) echo $cols->item(0)->nodeValue.'<br />'; echo '<hr />';
  6. I tried to do it this way: // make the cURL request to $target_url $html2 = curl_exec($ch2); // parse the html into a DOMDocument $dom2 = new DOMDocument(); @$dom2->loadHTML($html2); /*** discard white space ***/ $dom2->preserveWhiteSpace = false; /*** the table by its tag name ***/ $tables = $dom2->getElementsByTagName('table'); /*** get all rows from the table ***/ $rows2 = $tables->item(0)->getElementsByTagName('tr'); /*** loop over the table rows ***/ foreach ($rows2 as $row2); { /*** get each column by tag name ***/ $cols = $row2->getElementsByTagName('td'); /*** echo the values ***/ echo $cols->item(0)->nodeValue.'<br />'; echo $cols->item(1)->nodeValue.'<br />'; echo $cols->item(2)->nodeValue.'<br />'; echo $cols->item(3)->nodeValue.'<br />'; echo $cols->item(4)->nodeValue; echo '<hr />'; But it isnt returning anything except the word ACTIVE which is the last table value in HTML.
  7. I want to place each piece into a table within mysql database. Anyone?
  8. What would be the best way to break the following html into a table <div class="highlight">Name: CHRISTOPHER</div> <table summary="This table contains status information for the selected name."> <caption>Selected name status Information</caption> <tr> <th>Current Name:</th> <td>CHRISTOPHER</td> </tr> <tr> <th>Initial Filing Date:</th> <td>DECEMBER 15, 1997</td> </tr> <tr> <th>County:</th> <td>NEW YORK</td> </tr> <tr> <th>Jurisdiction:</th> <td>NEW YORK</td> </tr> <tr> <th>Type:</th> <td>Full Member</td> </tr> Would pregmatch or COMDocument be easier?
  9. Fixed it you have to put all the cURL settings in the loop.
  10. A list of the rows in the table. For some reason it isnt inserting into the string.
  11. no the same thing happens. I think instead of echo i should store the rows in an array but i have never used an array like this before.
  12. I had the wrong thing on my clipboard. it out puts p_doctor_name=&p_name_type=A&p_search_type=BEGINS
  13. I am retrieving a rowfrom a table and when I post the row variable it doesnt read it. ___ $query = "SELECT * FROM $tbl_name"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['name']; echo "<br />"; $postinfo = 'p_doctor_name=' . $row .'&p_name_type=A&p_search_type=BEGINS'; __ This outputs p_entity_name=&p_name_type=A&p_search_type=BEGINS Note that it is missing $row Do I need to put it in an array?
  14. Thanks I actually just tried that. Now I need to format the string to convert special characters like S&H Equities LLC what command do i use for that?
  15. I am trying to insert a variable into this post string: curl_setopt ($ch, CURLOPT_POSTFIELDS, 'p_entity_name=The+Company+Name+LLC&p_name_type=A&p_search_type=BEGINS'); I want to replace company name with $name like: curl_setopt ($ch, CURLOPT_POSTFIELDS, 'p_entity_name='+ $name + 'p_name_type=A&p_search_type=BEGINS');
  16. Thanks I think I need something similar to that. I am using cURL to POST a form submission. I have a list of names (searches for the form) in mySQL. So I think I need to do something like this within a loop to replace $nlink with each name in my mySQL table. curl_setopt ($ch, CURLOPT_POSTFIELDS, 'p_entity_name='+$nlink+'&p_name_type=A&p_search_type=BEGINS');
  17. I have a db called names with two columns, name and link. i have script that can run a name through a webpage by posting the data but i dont know how to make the script get the name from the db and then enter the corresponding link then go to the name in the next row within mysql.
  18. This cant be that hard to explain. Is it? How do I loop mysql lookups as variables to be entered into URLs in php?
  19. I have a list of names in a table and I am trying to search a website with each of these names. Can someone point me in the right direction if I want to POST each name to the site and use cURL to get the information(did this part already). Will a simple Loop or While command do the job?
  20. I have a list names in a database table in MySQL that I need to repeat the same search for on my system to get the associated information. Is there a Loop command or some type of trick to making a php script search table1.row1 then table1.row2 then table1.row3 etc. Basically using the row in the table as a variable for the other commands in the code. I really need some direction. Thanks.
  21. Awesome! That was it. Thanks so much for your help.
  22. I am fairly new at this so I have inserted my code. this is making it say Array over and over again in my database. // parse the html into a DOMDocument $dom = new DOMDocument(); @$dom->loadHTML($html); // grab all the on the page $xpath = new DOMXPath($dom); $hrefs = $xpath->evaluate("/html/body//a"); for ($i = 0; $i < $hrefs->length; $i++) { $href = $hrefs->item($i); $url = $href->getAttribute('href'); $patern ='/href="([^"]*)"/'; preg_match_all($patern, $text, $out); print_r($out[300]); $sql="INSERT INTO links(cid, nlink)VALUES('$out()','$out')"; $result=mysql_query($sql);
  23. Can you just make DOM pull out url's with CORPSEARCH in it?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.