473,408 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

CURL and SSL

Hi, all.

I need to screen scrap a page using CURL. I've been trying for hours the
access it, but I can't bypass its SSL protocl.

This is the code I've been using

private function ucitaj($url)
{

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec ($ch);
curl_close ($ch);

return new SimpleXMLElement($result);
}

This is the page it try to grab:
https://konet.kovanica.hr/tecajna?da...s_attachment=0

I tried googling for a solution, but i failed miserably. I don't know
what i+m doing wrong , and what I need to do to solve it.

Any help is really Appriciated

Nikola Stjelja
Aug 9 '07 #1
2 1811
On Thu, 09 Aug 2007 14:42:39 +0200, Knikola <ni****@komponenta.comwrote:
>I need to screen scrap a page using CURL. I've been trying for hours the
access it, but I can't bypass its SSL protocl.

This is the code I've been using

private function ucitaj($url)
{

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec ($ch);
curl_close ($ch);

return new SimpleXMLElement($result);
}

This is the page it try to grab:
https://konet.kovanica.hr/tecajna?da...s_attachment=0

I tried googling for a solution, but i failed miserably. I don't know
what i+m doing wrong , and what I need to do to solve it.
Works for me. What error do you get? (use curl_error() if the error is at that
point).
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 9 '07 #2
Andy Hassall wrote:
On Thu, 09 Aug 2007 14:42:39 +0200, Knikola <ni****@komponenta.comwrote:
>I need to screen scrap a page using CURL. I've been trying for hours the
access it, but I can't bypass its SSL protocl.

This is the code I've been using

private function ucitaj($url)
{

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec ($ch);
curl_close ($ch);

return new SimpleXMLElement($result);
}

This is the page it try to grab:
https://konet.kovanica.hr/tecajna?da...s_attachment=0

I tried googling for a solution, but i failed miserably. I don't know
what i+m doing wrong , and what I need to do to solve it.

Works for me. What error do you get? (use curl_error() if the error is at that
point).
I feel like an idiot. It works, I feel so stupid. That's what happens
when you are overworked, underpaid and something nasty bit you on your
stomach..

Thany Andy for your trobles

Cheers

Nikola Stjelja
Aug 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Haluk Durmus | last post by:
Hello I checked out openssl,mm,apr,apr-util,apache 2,curl,libxml and php from cvs. php couse an ERROR I did the following steps:
8
by: mrbog | last post by:
1. In order to make an http (or https) request with PHP, I need to recompile php with cURL. 2. In order to install CURL I have to upgrade my openssl rpm, even though I'm runing a version of...
3
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo():...
3
by: Hans | last post by:
Hi everybody, I am desperately trying to log into my account at godaddy.com with PHP and Curl and just cannot make it happen. Has anybody written a script for this purpose? Here is what I...
6
by: Shutdownrunner | last post by:
I want to store result of curl in a variable, which means to store a webpage in a variable in order to parse it later and get our some useful information. But unfortunately I'm not too experienced...
0
by: nfhm2k | last post by:
I've been trying to find a solution to this for quite some time now... I even took a look at existing scripts... Including this one......
4
by: Terry | last post by:
I'm using curl to invoke a php script on the same site/server. It works great, but if I call it again while it's still running, nothing happens. Why? Can that be fixed? Why use curl? To make...
4
by: zorro | last post by:
Hello there, I can't figure out why is it that when i use an array for my postfields it doesn't work : this works curl_setopt($curl, CURLOPT_POSTFIELDS, "clown=bozo" ); this doesn't...
0
by: xerc | last post by:
I am trying to create a generic function I can call to download all files from a single remote FTP directory -- using CURL. I want to multi-thread it, but need to get the single thread functionality...
3
by: rottmanj | last post by:
I am re-writing my rets application in perl, and I have found a few modules that will help me on my way. One of them being WWW::Curl:easy. During my testing, I have tested both system curl and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.