The web site donedeal.ie does not provide the capability to search or filter by certain fields which I want to filter by. I am trying to get the link to each result page from the search results pages. Then I would like to extract some text from these result web pages which have the same structure.
I have downloaded some search result list pages and have examined the HTML. I looked into using sed to extract the links to each individual result. Then I thought I should use the DOM somehow. I have been using PhantomJS and the Javascript console in Chrome developer tools.
This is an example of a results list page.
http://cars.donedeal.ie/find/cars/for-sale/Ireland/?filters%5BbodyType%5D=Saloon&ranges%5Bprice_from%5D=1000&ranges%5Bprice_to%5D=10000&sort=price&source=ALL
This is an example of an individual result page.
http://cars.donedeal.ie/cars-for-sale/01-passat/8313920
Each link is in a div with class="listing-info". The first element of that div is another div and the first element of this div is an a element.
<div class="listing-info">
<div class="title"><a href="http://cars.donedeal.ie/cars-for-sale/renault-megane/7911289" title="renault megane" > ... </a></div>
...
</div>
It is this href link that I am trying to get for all results on all pages at the moment.
The following is markup from an individual result page.
<div class="mainAdArea">
...
<table class="extraAdDetails">
<tbody>
...
<tr>
<td class="value">Manual</td>
<td class="value">Petrol</td>
<td class="value">1.6 litre</td>
</tr>
...
<tr>
...
<td class="value">
Mar 2015 </td>
</tr>
</tbody>
</table>
</div>
I would like the extracted information to look something like this:
Manual,Petrol,1.6 litre, ... ,Mar 2015
I think the easiest way to use the information would be to extract the information for each page onto 1 line in CSV format. I am completely open to suggestions however.
What is the easiest way to do any of this?
Related
As described in this and this answers, we can use HTML tags in Markdown to create tables with cells spanning multiple rows or columns. Suppose I want to make the following table (rendered by Visual Studio Code with extension "Markdown All in One"):
Desired Effect
But the problem for the second answer is that the rowspan/colspan of the first column/row will be rendered with a additional column/row in the front, as in the following example (does not work on StackOverflow, but works in VSCode; a work-around is to add an empty column/row, as suggested by the first comment in that answer, but this is still not perfect):
||Letter|Typesetting|Result|
|-|-|-|-|
|<td rowspan=4>a |Normal|a
||Italic|*a*|
||Bold|**a**|
||Math|$a$
Result:
Table constructed using method in Answer 2
Then we can use the HTML tags, as described by the first answer:
<table>
<thead>
<tr> <th>Letter <th>Typesetting <th>Result
</thead>
<tbody>
<tr> <td rowspan=4>a <td>Normal <td>a
<tr> <td>Italic <td>*a*
<tr> <td>Bold <td>**a**
<tr> <td>Math <td>$a$
</tbody>
</table>
But then Markdown formatting will be lost:
Table constructed using method in Answer 1
Is there any way to overcome this problem, i.e. using HTML tags to achieve rowspan/colspan without loss of Markdown text formatting?
I have created a table inside my template, using the Mediawiki programming language as explained in the documentation. In the table cells are an image and a text. Now I would like to make the whole table clickable, so that it links to a different page. To do this I use the wiki syntax and define the page, where the user should get referred. Then using the Pipe-character, I set the table code instead of a standard text.
Unfortunately, only the table gets displayed, while the source code of the Link syntax gets print out as a text. Is there a fix you can recommend me?
Or at least something temporary?
Here is my wiki source code:
[[:Category:{{{1|}}} Products|
{|
|[[File:Apple.png|50px|left|link=]]
|Order our apples
|}]]
This should be the html code it should generate:
<a href="http://example.com/Category:Apple_Products">
<table>
<tbody>
<tr>
<td>
<div class="floatleft">
<img src="http://example.com/Apple.png">
</div>
</td>
<td>
Order our apples
</td>
</tr>
</tbody>
</table>
</a>
(I also tried adding the following instead of the Link syntax:
<a href="http://example.com/</nowiki>{{#replace:{{{1|}}}| |_}}_Songs">
It did not work, because the parsing caused a conversion of ">" and "<" characters..
Working on an email blast and for the life of me I cannot get the text to center in mobile view. The URL is: http://strictpixel.com/clients/relevant/fbc/email/
I am referencing the top navigation, under the logo. In mobile, it slides to the left and I am not sure why.
I know this is something simple but I have been pulling my hair out for an hour.
Thanks!
Yeah that really is a mess and you should consider refactoring. There's no way you need all those nested tables.
However, if you plan to keep it this way, the problem is likely stemming from your HTML being invalid. First, the <center> tag is dead and should not be used. Second, you break the flow of your table structure beginning after the comment I inserted below:
<p class="template-label">469-952-6404</p></td>
<td class="expander"></td>
</tr>
</table>
</td>
<!-- You can't start the new table below here without first either
opening a new <td> or closing the <tr> and <table> that is open!! -->
<table class="container">
<tr>
<td class="wrapper">
<table class="twelve columns" style="background-color:#f1f5f8;vertical-align:center;">
...
My best guess is that you missed opening up the next <td> tag just before that table begins.
Use an online HTML validator to help you find where your table structure is broken. Something like http://www.freeformatter.com/html-validator.html may prove useful.
I am trying to implement a generic table widget (using KendoUI) having the data binding done with AngularJS.
The table widget would look something like this in the HTML file (fiddle here: http://jsfiddle.net/mihaichiritescu/ULN36/35/):
<div ng:controller="Tester">
<gridview>
<div data-ng-repeat="man in people">
<gridviewcolumn datasource="name" man="man"></gridviewcolumn>
<gridviewcolumn datasource="age" man="man"></gridviewcolumn>
</div>
</gridview>
</div>
Basically, the table would have an ng-repeat that would repeat through the list of objects, and for each object, using the 'gridviewcolumn', I would add cells under each row.
This way, I am trying to replicate the structure of the KendoUI table, which is something like this:
<div id="grid">
<div class="k-grid-header"></div>
<div class="k-grid-content">
<table>
<colgroup></colgroup>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="k-pager-wrap k-grid-pager"></div>
<div>
So, using the ng-repeat, for each object I will dynamically add a new row, and for each column I will add a new cell on the last added row. Unfortunately, I am not able to manipulate the ng-repeat directive in such a way that I will properly replicate the internal structure of the KendoUI grid view. I am ending up with an internal table structure looking like this:
<div id="grid">
<div data-ng-repeat="man in people" class="ng-scope">
<div datamember="name" man="man" class="ng-binding">name1</div>
<div datamember="age" man="man" class="ng-binding">21</div>
</div>
<div data-ng-repeat="man in people" class="ng-scope">
<div datamember="name" man="man" class="ng-binding">name2</div>
<div datamember="age" man="man" class="ng-binding">25</div>
</div>
<div class="k-grid-header"></div>
<div class="k-grid-content">
<table>
<colgroup></colgroup>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="k-pager-wrap k-grid-pager"></div>
<div>
I would like to somehow place the content of the ng-repeat directive in the body of the table, not above it. Does anyone know how to accomplish this?
I could use jquery to place the content into the cells, but I would still have to remove/hide the ng-repeat directives and their content from above the table body, which I do not know how to do without some ugly hacks.
Also, I am not necessarily bound to KendoUI gridview, but it seems better looking than others, and it probably has similar internal structure to other table widgets, so I would encounter the same issue with other widgets too.
Do you guys have some ideas/advice on how to implement a generic table using AngularJS? I did search for some tables done with AngularJS, but I did not find something that would have good functionality and looks.
I have created two fiddles which would demonstrate how what you are trying to achieve could be done. The first fiddle uses ( http://jsfiddle.net/ganarajpr/FUv9e/2/ ) kendoui's grid ... So its style and display is complete. The only caveat being it wont update if the model changes. This is because kendoui takes the data first and then produces all the UI elements based on the model provided at the beginning.
The alternate is to use Kendo's UI (css) and leave out the grid producing code.
http://jsfiddle.net/ganarajpr/6kdvC/1/
This I believe is closer to what you were looking for. It also demonstrates the use of ng-repeat in a table.
Hope this helps.
Using contenteditable in html5 will easily help you.
Is there a way to grab things out of the source code of another site directly into your site?
For example, let's say than in a site the following source code exists:
<table ...>
<tr>
<td class=...>...</div></td>
</tr>
<tr>
<td class=....><div align="... class=...>"Interesting string that keeps changing"</div></td>
</tr>
</table>
And we want that Interesting string that keeps changing to appear in our website as well.
you could use php
you use
$html = file_get_contents('url to website');
or use a hidden if you want a javascript function, and then just grab the innerhtml