Extracting Header From A Webpage?
Mar 22, 2010How can i extract title,header of a web page directly from the internet??
View 3 RepliesHow can i extract title,header of a web page directly from the internet??
View 3 RepliesI have a datalist that is populated via and SqlDataSource. Code is VB
I am trying to extract two Values from the Item Templete and add them together. Then I want to add a new Label to the item template with the sum of the two added values.
I am able to to this using a GridView but no success with the datalist
My form code:
<asp:Label
ID="SDLabel"
runat="server"
Text='<%# Eval("SD") %>'></asp:Label><br
/>
SDT<asp:Label
ID="SDTLabel"
runat="server"
Text='<%# Eval("SDT") %>'></asp:Label><br
/>
SDS:<asp:Label
ID="SDSLabel"
runat="server"></asp:Label><br
/>
My VB Code behind Starts out:
[Code]....
This may be something simple, but I am completely new to ASP.NET. I have been reading some tutorials based on W3Schools, and I have copied one of the files and tried to play with it by changing an element with a value to storing that same value in the attribute. Here is the edited XML (my.xml):
<?xml version="1.0" encoding="ISO-8859-1"?>
<countries>
<country>
<text value="N">Norway</text>
</country>
<country>
<text value="S">Sweden</text>
</country>
</countries>
I want to extract the N and S and use them as tooltips. Here is my aspx file:
<%@ Import Namespace="System.Data" %>
<script runat="server">
sub Page_Load
if Not Page.IsPostBack then
dim mycdcatalog=New DataSet
my.ReadXml(MapPath("my.xml"))
my.DataSource=my
my.DataBind()
end if
end sub
</script>
<html>
<body>
form runat="server">
<asp:Repeater id="my" runat="server">
HeaderTemplate>
table border="1" width="100%">
<tr>
<th>Name</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td title="<%#Container.DataItem.("text").Attributes["value"]%><%#Container.DataItem("text")%> </td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>
</body>
</html>
What have I missed here?
Is there a reliable way to extract text from PDF? The first thought that comes to mind is that PDF may have multiple columns and the extraction mechanism needs to know the logical structure somehow. I understand that some PDF docs are "tagged" but I'd need to support pretty much any PDF document.
Any third party components to the rescue here?
public void ZipExtract(Stream inputStream, string outputDirectory)
{
using (ZipFile zip = ZipFile.Read(inputStream))
{
Directory.CreateDirectory(outputDirectory);
zip.ExtractSelectedEntries("name=*.jpg,*.jpeg,*.png,*.gif,*.bmp", " ", outputDirectory,
ExtractExistingFileAction.OverwriteSilently);
[Code]....
I try to read zip archive from stream and extract files. Got the following exception in the line "using (ZipFile zip = ZipFile.Read(inputStream))" : ZipEntry::ReadDirEntry(): Bad signature (0xC618F879) at position 0x0000EE19. how to handle this exception?
i am trying to extract xml element by name and below code does work but it does returns all 4 elements and below is my xml file.
what i want is to extract the frist element(StripImages)[0] ???
var xmlDoc = new XmlDocument();
xmlDoc.Load(menuUrl);
var stripImages = xmlDoc.GetElementsByTagName("StripImage");
<Main>
<Author>
[Code]....
I found an application that interacts with one of googles APIs that sends requests to the API and returns results to the web page. The owner of this app has made it publicly available and even though it is hosted on his server, it acts directly with the api from anyones browser. The source code in page source is available but since I dont know javascript, it is meaningless to me.
I would like to create an app that calls this web app and have it send requests to the API, and have the results parsed to a database. Would this be possible?
I have very little ASP experience and since trying to work through accessing the API itself is complicated since it involves using oAuth protocol and I am having a hard time with this with not much sample code available.
If this is possible, how can I get access to the results from this web app?
Every morning we get a few hundred emails from our various customers servers that tell us how their backup went that previous night. Somebody has to go through these and fill out an excel spread sheet. I would like to automate this, we have our own server running a .NET application so i can schedule something every morning.
There are two main parts. The first is i want to know how to create a table that has customers down the left and dates accross the right, they are called pivot tables in access but not sure how to recreate them in MSSQL and to do it on the fly as i dont want to have to sit there entering 100's of days at a time.
The second is that differnt customers use differnt backup solutions, so i want to write some code that scans a particular mailbox in exchange, looks for emails that have come in in the past 12 hours, look at the from email address and match that to one in the database, then according to the subject line it will be able to identify what type of backup solution it is, e.g. if it says "Backup Exec Job completd Sucessfully" it knows its backup exec and will look for a particular text (completed successfully, completed with exceptions, no media etc) and can insert that, or if its a differnet backup solution then go and look at a specific place in that email for it.
I have an HTML string like
<A HREF="/files/1234/mybook.b1">mybook.b1</A><br>11/24/2010 1:02 AM 991
I want to fetch only the date element from this string. i.e 11/24/2010 1:02 AM
I know i can do that using the substring method of string class but i need to implement a standard solution for this problem. i.e. fetch date from any html content if it contains a date element.
I have a requirement wherein a SQL query will be given in a text file.
The text file has to be read , the SQL query needs to be parsed and the column names, table names and where clauses have to be extracted and inserted into separate tables.
DB: Sql Server
Using SPGridView, I want to fill textboxes with the SPGridview Selected Row Data on a button click event.
txtCode= SPGridView.SelectedRow.Cell[1].Text;
On debugging, it shows Cell[1] is empty but it is showing data in the Grid.How can this be achieved?
i am using the below code for extracting paragraph for matching string.
[code]...
i am getting correct result,but i am getting breakable words in starting and ending paragraphs like "...ing regions uses the and Boolean connector to specify the region so narr..."
I have a Portable Bridge Notation formatted-file that I have to work with. I have already a few simple examples working by using indexing and substrings extracting what I need and I suppose for this PBN business it would suite me well since it isn't run too often. If I one the other hand would run that code like all the time (thinking of working with vCards) then I am worried about memory usage under high workload because of the high amout of temporary string variables created from all substrings and splits.
There are two other options available that I know of. Regex and StringReader / TextReader and I wanted some general opinion on what to use.
Intended usage is to extract to objects and serialize to json so that I can more easily work with or persist this information. Hell if it's fast enough I might even do it on the fly.
The task is: given a web application that returns a table with pagination, do a software that "reads and parses it" since there is nothing like a webservice that provides the raw data. It's like a "spider" or a "crawler" application to steal data that is not meant to be accessed programmatically.
Now the thing: the application is made with standart aspx webform engine, so nothing like standard URLs or posts, but the dreadful postback engine crowded with javascript and non accessible html. The pagination links call the infamous javascript:__doPostBack(param, param) so I think it wouldn't even work if I try even to simulate clicks on those links.
There are also inputs to filter the results and they are also part of the postback mechanism, so I can't simulate a regular post to get the results.
I was forced to do something like this in the past, but it was on a standard-like website with parameters in the querystring like pagesize and pagenumber so I was able to sort it out.
Anyone has a vague idea if this is doable, or if I should tell to my boss to quit asking me to do this retarded stuff?
EDIT: maybe I was a bit unclear about what I have to achieve. I have to parse, extract and convert that data in another format - let's say excel - and not just read it. And this stuff must be automated without user input. I don't think Selenium would cut it.
EDIT: I just blogged about this situation. If anyone is interested can check my post at [URL] and comment about that.
I'm reading an excel file using oledb in my asp.net code (vb).I have no problem going over the data but in one of the cells there is a string that "hides" a hyperlink. I want that hyperlink and not the string...
View 1 RepliesI referenced this page, how to extract data from a gridview on a webpage. [URL] ....
I can extract to a Word, Excel and CSV but I can't to a pdf file. I get the following error:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.Source Error:
Line 135: Response.Write(pdfDoc);
Line 136: Response.End();
Line 137: } Line 138:
Line 139: protected void btnExportCSV_Click(object sender, EventArgs e)
[Code] ....
how to display a header of gridvew as a 3D view color Header?
View 14 RepliesScenario:
I have a Gridview where I want to handle the Sorting in a custom control that I've added to the header.
I've added this control to my GridView's Header via OnRowCreate event handling. I want the Sort Expressions to persist session to session (via Webparts Personalization)
Here is what I have for adding the custom header control to the GridView Header
[Code]....
This works out well for adding the control, but I can't get anything to persist because these controls are creating initially via postback (per the event) and re-created on all subsequent postbacks. I can't add an If(!IsPostback) because the controls are initially created on the gridview's postback (well at least thats how it's acting when I put it in there) If I were to add this control via the ASP page, not via the Codebehind, I would be able to persist the control. If I try to treat it as though everything is setup correctly, and assign my custom control's controls to [Personalizable], I get a runtime error telling me that I can only have webpartzones in or before Page_init (I'm guessing this is due to when/where the
gridview hits the OnRowCreate event). If there is some fundimental logic I'm missing, or best practices that I'm moving away from,
I call a webservices from my javascript and im getting response as error.
Server did not recognize the value of HTTP Header SOAPAction:
is there anyway i can add in the gridview in header column name a button instead of label ?
column name 1 column name 2 column name 3 button
i am using checkbox column in item template for the button ,i wish after selecting checkbox for some row to click on the button on the header !!
In my ASP.Net (2.0) Web Service implementation (The implementation class derives from
System.Web.Services.WebService with WebServiceBinding confirming to WsiProfiles.BasicProfile1_1 .
The SOAP response sent out by the Service has two elements missing :
1> The XML header itself : (<?xml version="1.0">)
2> The opening and closing Envelope tags with NameSpace ("<S:Envelope xmlns:S=http://schemas.xmlsoap.org/soap/envelope/>" and "</S:Envelope>" ).
This results in "breaking" of my client unless the above mentioned headers are inserted at the client end, and my intent is to avoid bypasses at the client end as far as popssible.Is this the default behavior ?
i have a problem with ListView control,when i bind data to it, it shows the heder of it also.
i don't want to show me the hedear, what should i do?
[Code]....
I am using the following code to change the header based on the session variable
[code]....
How to pass gridview particular column values to another page's table header...
View 1 RepliesI have a Tab Container that I would like to be able to add a star (*) at the end of the tab header text when there are NEW Users to be approved by the Site Administrator. By default meaning that is what I typed in designer mode is "Users Waiting Approval", but when I load the page I run a routine to see if there are and new users requesting access and at that point durning the page load I would like to change the tab from "Users Waiting Approval" to "Users Waiting Approval *" with the star at the end (*). How can I update this tab header text durning the page load event? Is there some javascript function I can call like set_HeaderText?
View 1 Replies