turn any site into a JSON api using xpath
pip install -r requirements.txt
- run the code server
python cod_server.py
- send the
url
andxpath
that you want to crawl to the code server, it will return you the correponding xpath result.
$(function(){
$.ajax({
url: 'http://127.0.0.1:5000/',
type: 'POST',
dataType: 'json',
data: {
'url': 'https://news.ycombinator.com/',
'xpath': '//*[@class="storylink"]'
},
success: function(data){
$('#result').html(data['result']);
}
});
});
- Handle ajax rendered pages