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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:05:20+00:00 2026-06-14T18:05:20+00:00

I met some strange simplehtmldom behaviour. I get $newlink from some page, then put

  • 0

I met some strange simplehtmldom behaviour.

I get $newlink from some page, then put it into another curl, return blank data. If I change

curl_setopt($ch1, CURLOPT_URL, $newlink);

to

curl_setopt($ch1, CURLOPT_URL, "http://www.granma.cu/italiano/sport/22-noviembre-iaaf.html");

the data is being displayed. Where’s my error?

<?php header("Content-Type: text/html; charset=utf-8"); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<?php
require dirname(__FILE__) . '/simple_html_dom.php'; 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://youlichika.netii.net/aaa.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
$htmls = curl_exec($ch);
curl_close($ch);
$html = str_get_html($htmls);
$newlink = $html->find('p',0);
echo $newlink;
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL, $newlink);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch1, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
$newhtml = curl_exec($ch1);
curl_close($ch1);
echo $newhtml;
?>
  • 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-14T18:05:21+00:00Added an answer on June 14, 2026 at 6:05 pm

    You need to use $newlink->innertext to get the content in between the <p> tags.

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

Sidebar

Related Questions

i met a very strange PHP behaviour, i don't understand why it behaves like
i've met a strange behaviour in Firefox with this simple script: <html> <head> <script
I have run into a strange to me problem. For some reason multiple ||
I am developing WP7 app. I met some unexpected behavior. I use PerformanceProgressBar from
I want to insert some value from first and second foreach into database, but
I have some MET data I want to validate which would look something like
I have some logic in before_save whereby (only) when some conditions are met I
here I am trying to call overloaded constructor after some condition has met in
I met strange problem. I have never work with Devise gem before. So, i
I met a problem which is very strange, my company uses Visual Source Safe

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.