473,396 Members | 1,799 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,396 software developers and data experts.

Screen Scrape Issue preg_match

I need to create a simple page to find the .gif file below from the
page below. No matter what I try it doesn't work.... Any ideas?

http://www.toysrus.com/product/index...ductId=2327085
prod_AddtoCart.gif

Oct 24 '06 #1
4 1904
Rik
ca***********@gmail.com wrote:
I need to create a simple page to find the .gif file below from the
page below. No matter what I try it doesn't work.... Any ideas?

http://www.toysrus.com/product/index...ductId=2327085
prod_AddtoCart.gif
preg_match('|<div[^>]*?id="toShow"[^>]*>.*?<img[^>]*?src="([^"]*)"|si',$htm
l,$match);
$src = $match[1];

--
Grtz,

Rik Wasmus
Oct 24 '06 #2
Rik,
Thanks but can you take a quick look, i still can see to get it to
work.

<?php

$html =
file_get_contents('http://www.toysrus.com/product/index.jsp?productId=2327085');

preg_match('|<div[^>]*?id="toShow"[^>]*>.*?<img[^>]*?src="([^"]*)"|si',$html,$match);
$src = $match[1];

echo $src;


?>
Rik wrote:
ca***********@gmail.com wrote:
I need to create a simple page to find the .gif file below from the
page below. No matter what I try it doesn't work.... Any ideas?

http://www.toysrus.com/product/index...ductId=2327085
prod_AddtoCart.gif

preg_match('|<div[^>]*?id="toShow"[^>]*>.*?<img[^>]*?src="([^"]*)"|si',$htm
l,$match);
$src = $match[1];

--
Grtz,

Rik Wasmus
Oct 24 '06 #3
Rik
ca***********@gmail.com wrote:
Rik,
Thanks but can you take a quick look, i still can see to get it to
work.

The reason is as simple as evil.

When opening it with PHP, the page terminates prematurely on:
<!-- useragent: null -->

They rely on user-agent detection to build the rest of their page, and
don't revert to anything if it's not recognized.

To gather the HTML, you're best of using CURL, and fake a User-Agent.
--
Rik Wasmus
Oct 24 '06 #4
Rik,
Would you be interested in doing this for me? I can pay you through
paypal?

You can respond through here and I can then contact you through your
email attached?

Rik wrote:
ca***********@gmail.com wrote:
Rik,
Thanks but can you take a quick look, i still can see to get it to
work.


The reason is as simple as evil.

When opening it with PHP, the page terminates prematurely on:
<!-- useragent: null -->

They rely on user-agent detection to build the rest of their page, and
don't revert to anything if it's not recognized.

To gather the HTML, you're best of using CURL, and fake a User-Agent.
--
Rik Wasmus
Oct 24 '06 #5

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

Similar topics

0
by: Jason Steeves | last post by:
I have one .aspx form that my users fill out and this then takes that information and populates a second .aspx form via session variables. I need to screen scrape the second .aspx form and e-mail...
3
by: Ollie | last post by:
I know you can screen scrape a website using the System.Net.HttpWebResponse & System.Net.HttpWebRequest classes. But how do you screen scrape a secured website (https) that takes a username &...
2
by: Rob Lauer | last post by:
I have written two completely separate web applications that cannot talk directly to one another (applications "A" and "B"). Application "A" has a form that takes some input (radio buttons,...
5
by: crjunk | last post by:
I have a screen scrape page that allows the user to submit a url. When they hit submit, the page is returned back to them on my screen scrape page. Which computer actuall connects to the url to...
4
by: alan.aylett | last post by:
Hi, I have three years experience programming with Java so am programming language literate. I have to implement a tool to 'screen scrape' and it is apparent that this is simplest using the .NET...
7
by: Swanand Mokashi | last post by:
Hi all -- I would like to create an application(call it Application "A") that I would like to mimic exactly as a form on a foreign system (Application "F"). Application "F" is on the web (so...
7
by: ljr2600 | last post by:
Hello, I'm very new to python and still familiarizing myself with the language, sorry if the post seems moronic or simple. For a side project I'm working on I need to be able to scrape a...
1
by: nbomike | last post by:
Hello. I want to scrape pages from a site that generates pages from form inputs using this web app . However, the URL of the results page (the page I want to scrape) is masked and is always the same....
1
by: newdev | last post by:
Hi All, Can somebody maybe please help me? - how do i screen scrape data from a dos application / window to .net application by using c#? - how do i screen scrape data from a dos application /...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.