Jump to content

File get contents


muppet77

Recommended Posts

I’d like to get the points estimates and fooball team names from a site as variables in php.

I’ve tried file get contents and also htmlentities but I can’t seem to spot the team names or prices in there.

 

What’s happening? Why don’t they appear in my php output?

 

One site is

https://mobile.sportingindex.com/markets/4855dfa3c28b43ceb332768100728224/c0c1dc8fc78347cca90c48e40328a64b/group_a.7e4187d6-9e42-4bb0-9bde-779fd4019f61/00000000000000000000000000000000/

 

And another that gives the same data so will also be ok to use instead of the first is

https://www.spreadex.com/sports/mobile/page/spr/596301/1/10047

 

Thanks for any help.

Link to comment
Share on other sites

No he pointed out that you provided no code, or debugging information.

 

It could certainly be that the site is looking for agent information and you are not getting the same output you normally would because your scraping code doesn't look like a normal browser.

 

I can also tell you in advance, that to parse html pages with php, I would highly recommend using either simplexml or DOM to load and subsequently locate and parse individual elements from the page.

 

If you want further help, we need to see at very least, relevant code snippets.

Link to comment
Share on other sites

You think one line of code tells us what you are doing?

 

Why are you using htmlentities? Please explain.

 

If this were me, I would first examine the actual unmodified code that you are reading and search for recognizable items that identify the parts that you want to extract. Perhaps a div tag with a certain class or id value. Or even another tag that has a name attribute. That's why I wonder why you are using htmlentities.

Link to comment
Share on other sites

Hi giner jm

 

Actually that is all my code!

I’ve added HTML entities because without it, the actual webpage appears in my browser.

 

 

Without it, I can see the source code to see if the teams are there and what to then target to extract the team names one by one.

Link to comment
Share on other sites

Those sites load all their details via some ajax process so the information you want isn't going to be in the source. It you want to swipe their info you'll have to spend time reverse engineering their site and figure out what requests are needed to get the information you want. That or hire someone to do it for you.

Link to comment
Share on other sites

I always use 'view source' in my browser so didn't see it your way. But 'seeing' the data as a web page makes it easier to visually search for something and THEN look in the 'source' to find the surrounding html items that identify it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.