Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

crawl the website and get contents

7 views
Skip to first unread message

apoorv....@gmail.com

unread,
Apr 6, 2016, 2:29:31 AM4/6/16
to
Hello I am developing a website In which user will paste the url from e-commerce site like amazon and that product will display on my site when user will click on that site it will take them to amazon and I will get commission being affiliate of amazon.

I can get all the contents using curl or file_get_contents But I want to get specific data like product image and price not all data.

Erwin Moller

unread,
Apr 6, 2016, 6:09:09 AM4/6/16
to
On 4/6/2016 8:29 AM, apoorv....@gmail.com wrote:
> Hello I am developing a website In which user will paste the url from e-commerce site like amazon and that product will display on my site when user will click on that site it will take them to amazon and I will get commission being affiliate of amazon.
>
> I can get all the contents using curl or file_get_contents But I want to get specific data like product image and price not all data.
>


Did you contact Amazon for advice?

Things tend to get pretty hard if you must scrape it all from raw HTML..

Why?
A few reasons:
1) the HTML itself can change when Amazon feels like it.
This will make it hard for you to parse through the HTML, because
the structure changed. Are you willing to update your logic whenever
Amazon changes the HTML?

2) Many websites use a LOT of clientside processing to build the
document. This means that the HTML you receive is just the beginning of
the whole pagebuilding. The rest is fetched after the initial HTML load,
and added to the DOM by JavaScript (ECMA).

In all honesty: If you have to ask in here about images/curl/prices/etc,
I think you are not up to that job.

Best thing to do is contact amazon and ask them if they have an easier
way to grab that data.
If they want to encourage what you do, I expect they have.

Regards,
Erwin Moller



--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
0 new messages