I
I
Ivanko2018-03-19 22:55:36
Parsing
Ivanko, 2018-03-19 22:55:36

How to parse data from another site?

How can one site parse the value inside the .ClassName of another site?
Something like:

$.ajax({
    url: 'https://getbootstrap.com',
    type: "GET",
    crossDomain: true,
    dataType: 'html',
    success: function (responseHTMLData) {   
        $($(responseHTMLData).find('.bd-text-purple-bright')).each(function() {
            console.log($(this).attr('href'));
        });
    }
});

or s.p. phpQuery/Curl is it better to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
maksam07, 2018-03-20
@ivan99

simple_html_dom I don't
think I have anything more to add.

B
bro-dev, 2018-03-20
@bro-dev

If you like to parse directly from the browser, you need to disable protection in it, for this there are plugins like https://chrome.google.com/webstore/detail/allow-co...
Of course, it's better to do this on the server side. But if you really want it, you can. There is also a way to write an address wrapper in your php script, it will download the page from the server and return it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question