Answer the question
In order to leave comments, you need to log in
How to make the parser follow links?
Good afternoon experts!
More recently, I asked a question about which tool to use to write an easy and simple data parser from a site. We talked about Osmosis and Simple HTML DOM. Good stuff, but I have one more little question about them. How can you make these parsers enter data into fields and click buttons on the site?
In particular, you need to enter the VIN number of the car on the site with spare parts , press the search button, go to a specific section and take the numbers of certain parts from there. How can this be implemented? I thought to substitute the VIN number in the address bar so that there was a GET request, but the search generates a link like https://site/model/numbers/letters:and:numbers/?vin=numbers,and you can't create it yourself. In general, I don’t understand how to make the parser use the search on the site and enter the desired section.
Answer the question
In order to leave comments, you need to log in
If you look closely, there is a function called
function searchVIN() {
var vin = $('input#search-vin').val()
if (vin.length == 0) {
alert('Не указан ВИН автомобиля')
$('input#search-vin').focus()
return
}
if ((vin.length != 7) && (vin.length != 17)) {
alert('Неверная длина ВИН автомобиля. Должно быть 7 или 17 символов')
$('input#search-vin').focus()
return
}
$('input#search-vin').attr('disabled', 'disabled')
$.post(
'/ajax_vin_bmw.php',
{
'vin': vin
},
function (s) {
if (s.substr(0,1) == '/') {
document.location.href = s
} else {
alert(s)
$('input#search-vin').removeAttr('disabled')
}
}
)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question