Hello!
I have this html code:
<table>
<tr>
<td class="test"><b><a href="">aaa</a></b></td>
<td class="test">bbb</td>
<td class="test">ccc</td>
<td class="test"><small>ddd</small></td>
</tr>
<tr>
<td class="test"><b><a href="">eee</a></b></td>
<td class="test">fff</td>
<td class="test">ggg</td>
<td class="test"><small>hhh</small></td>
</tr>
</table>
I use this Python code to extract all <td class="test"> with lxml module.
import urllib2
import lxml.html
code = urllib.urlopen("http://www.example.com/page.html").read()
html = lxml.html.fromstring(code)
result = html.xpath('//td[@class="test"][position() = 1 or position() = 4]')
It works good! The result is:
<td class="test"><b><a href="">aaa</a></b></td>
<td class="test"><small>ddd</small></td>
<td class="test"><b><a href="">eee</a></b></td>
<td class="test"><small>hhh</small></td>
(so the first and the fourth column of each <tr>)
Now, I have to extract:
aaa (the title of the link)
ddd (text between <small> tag)
eee (the title of the link)
hhh (text between <small> tag)
How could I extract these values?
(the problem is that I have to remove <b> tag and get the title of the anchor on the first column and remove <small> tag on the forth column)
Thank you!
Is there any API or webservices that allows us to manage online Office web apps documents (on sky drive)?
What I would like to do is to use this API (or webservice) in order to create some reports in excel format without the need to use the HTML table trick, neither to have the Excel Com components installed on my server.
Consider the following table which has the fields - id (int) and date_created (datetime):
id date_created
1 2010-02-25 12:25:32
2 2010-02-26 13:40:37
3 2010-03-01 12:02:22
4 2010-03-01 12:10:23
5 2010-03-02 10:10:09
6 2010-03-03 12:45:03
I want to know the busiest/most popular hour of the day for this set of data. In this example, the result I'm looking for would be 12.
Ideas?
I have a table with the following columns:
id, teamA_id, teamB_id
Will it be possible to write a SELECT statement that gives both teamA_id and teamB_id in the same column?
EDIT:
Consider this example
From
id, teamA_id, teamB_id
1, 21, 45
2, 34, 67
I need
Teams
21
45
34
67
Hui folks,
I need to be able to store numbers like 3.5 in my table. So I've used the decimal type field. But if I enter 3.5 it round it up to 4. Am I being stupid or is it not the point of decimal to have a decimal point?
Thanks,
Jonesy
hello, i have a table with a date, this date is a string i want to compare this string with a date in my request.
SELECT FE_CLIENT.*
FROM FE_CLIENT
WHERE D_DATFINPUBLI < '2010/06/03'
How can i cast my column date_deb to a date for compare ..?
Can somebody tell me, why does Linq to Entities translate many to 1 relationships to left outer joins instead of inner joins? It relation was many to 0..1. There's referential constraint on DB itself, that ensures there's a record in the right table, so inner join should be used instead.
Is it possible to write LINQ in a way so they will translate to inner joins rather than left outer joins. It would speed query execution a lot.
I want to extract a specific data from the website from its pages...
I dont want to get all the contents of a specific page but i need only some portion (may be data only inside a table or content_div) and i want to do it repeatedly along all the pages of the website..
How can i do that?
I need to design a calendar control which should be added to our companie's application (I know there's already quite a lot calendar controls but I shall develop our own one...).
How should I start, should I use a kind of table to display the days or should I completely draw my own grid? How can I do this (I do not need rdy-to-use code, I just need some ideas...)
Hey,
I'm using OpenJPA as a JPA provider.
Is there a way in which I can recreate the database tables (When an entity changes) without dropping the entire data?
When an entity changes, I drop and create every table in the store, and obviously lose the data within. Is there a tool or product to keep the data somehow?
Thanks,
Udi
I have this, birthday selection which is in 3 combobox, 1 for month, 1 for day and 1 for year.
But my database table has only this birthday attribute(no year, month or day).
How can I combine the items that are selected in those 3 combo boxes so that they would be fitting in the birthday column?
hi there,
I'm using MS Sql Server and I want to use identity constraint in it
I know how to use it in following manner
create table mytable
(
c1 int primary key identity(1,1);
)
the above code works fine but what if i want the identity column to have values as EMP001, EMP002,... instead of 1,2....
Thanks in advance,
Guru
I am working on a Incoming and outgoing messages webform, I would like to show the users the only messages in their INBOX of one day behind. I have a dropdown where I'm giving the selection of All and Pending messages. But if the users have any pending messages in INBOX of just one day behind ,they have to choose All to retrieve the messages.
So how do I retrieve messages from message table of just one day behind ? I am using SQL 2000 vb.net web application.
I accidently changed the "host" value for the root user inside of the user table for mysql.
I need to change it back to localhost because I changed it to arancillary2125 (my other machines DNS name) but I cannot access mysql (from PHPMYADMIN or command prompt) due to "localhost" not having permissions anymore.
I am running windows XP // apache //
I have tried the following solutions but they didn't work:
http://serverfault.com/questions/92870/1130-host-localhost-is-not-allowed-to-connect-to-this-mysql-server
I regularly need to delete all the data from my postgresql database before a rebuild. How would I do this directly in SQL?
At the moment I've managed to come up with a SQL statement that returns all the commands I need to execute:
SELECT 'TRUNCATE TABLE ' || tablename || ';' FROM pg_tables WHERE tableowner='MYUSER';
but I cant see a way to execute them programatically once I have them...
Thanks in advance
I have a query that selects some fields to display from a table
SELECT Field1, Field2, Field3, Field4 FROM table1
I want instead of returning :
To return:
How could I modify my SQL statement to return the second figure ?
Or at least how to change the gridview properties of .Net to do so (if this is possible) ?
hello Dear
i just need to auto generate id like abc101,abc102,abc103,....abc10n
and it should be store in DB table. and also it should be show in any textbox at runtime .
Please give a proper solution....
Special Thanks in advance :)
Regards.
Pradeep Kodley
In one of my models, I have a "LONGTEXT" field that has a big dump of a bunch of stuff that I never care to read, and it slows things down, since I'm moving much more data between the DB and the web app.
Is there a way to specify in the model that I want CakePHP to simply ignore that field, and never read it or do anything with it?
I really want to avoid the hassle of creating a separate table and a separate model, only for this field.
Thanks!
Daniel
Hi,
I'm wondering whether it's possible to use built in ASP.NET application services (aspnet_user, aspnet_role etc table) without specifying a connection string in a web.config.
At the moment I store connection strings externally, but I keep finding hard-coded connection strings all over the web.config xml, various providers etc. It's driving me crazy.
Thank you
I currently have a database with over 6 million rows and growing. I currently do SELECT COUNT(id) FROM table; in order to display the number to my users, but the database is getting large and I have no need to store all of those rows except to be able to show the number. Is there a way to select the auto_increment value to display so that I can clear out most of the rows in the database? Using LAST_INSERT_ID() doesn't seem to work.
I am looking to fileupload a picture jpeg,gif,etc into an SQL database on an updateprofilepicture page. Then on the profile page, I want to retrieve the image from an sql database and have it show up in an Asp:Image control. I have much code trying to do this and it doesn't work. The table contains a column of type Image.