I need to grab contact details of people that appears pretty much in the same bit of code after the words:
"For further information, please contact:"
So I want the href (http://www.wongpartnership.com/index.php/wongpartnership/partner/chan-hock-keng)
and the name (Hock Keng)
Tried variations of //strong[contains(., 'For further')]/following-sibling::p
but not working
Code:
<p><span style="font-size:14px;"><span data-mce-style="font-size: small;"><strong>For further information, please contact:</strong></span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span data-mce-style="font-size: small;"><strong><a data-mce-href="http://www.wongpartnership.com/index.php/wongpartnership/partner/chan-hock-keng" href="http://www.wongpartnership.com/index.php/wongpartnership/partner/chan-hock-keng" target="_blank">Hock Keng</a></strong><strong><a data-mce-href="http://www.wongpartnership.com/index.php/wongpartnership/partner/chan-hock-keng" href="http://www.wongpartnership.com/index.php/wongpartnership/partner/chan-hock-keng" target="_blank"> </a></strong><strong><a data-mce-href="http://www.wongpartnership.com/index.php/wongpartnership/partner/chan-hock-keng" href="http://www.wongpartnership.com/index.php/wongpartnership/partner/chan-hock-keng" target="_blank">Chan</a></strong><strong>, Partner, WongPartnership</strong></span></span></p>
Related
I am trying to make a text collapsible when I press the word 'Abstract' in my webpage, https://rubencioak.github.io/research.html, I thought the following code was going to be enough:
<ol class="lead">
<li> <p> <b>Free-riding in Collective Agreements,a Search and Matching Model of Minimum Wages</b>
<br />
<span id="abstract-link" class="abstract-click">Abstract</span>
<p class="abstract-text" style="display:none; font-size:.90em">Does free riding in collective... unemployment, at a cost of employed earning less</p>
</p> </li> </ol>
I am using a templeate from HTML5 and also looking at this webpage: https://messertodd.github.io/research.html. for reference.
Now, although I thought it was basically the same, something is obviously wrong with this code.
All in all, the question is: is there a simple way to make my text under the word abstrac collapsible?
Any help would be much appreciated.
KR
You can use <details> and <summary> tags:
<details>
<summary>Abstract</summary>
<p class="abstract-text" style="font-size:.90em">Does free riding in collective... unemployment, at a cost of employed earning less</p>
</details>
I am looking for some way on how to view source of some elements in the webpage https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuote.jsp?symbol=ITC&illiquid=0&smeFlag=0&itpFlag=0
In that page, under the tab Company Information, we have Company Announcements like Press Release, Allotment of ESOP/ESPS etc. Under each of these headers, there are more information provided. However when I look into the Source-page, I dont see those information.
Any idea on how to find those information in the source-page.
Thanks for any pointer.
They are siblings of the title, not children.
<h3 class="alt active">
<span id="ca21">Allotment of ESOP/ESPS</span>
<span class="date" id="ca22">26-Oct-2018</span>
</h3>
<div class="alt" id="ca23" style="display: block;">ITC Limited has informed the Exchange regarding allotment of 986060 Equity Shares under ESOP</div>
I'm trying to extract certain details from articles which are combined in an html file. The html file will consist of 1000s of articles so trying to automate the extraction using BeautifulSoup. For the first article I can get it to extract but do not seem to get it to automatically move on to the next article. This is how the html looks like:
<DOCFULL> -->
<br/>
<div class="c0">
<p class="c1">
<span class="c2">
2 of 4 DOCUMENTS
</span>
</p>
</div>
<br/>
<div class="c0">
<br/>
<p class="c1">
<span class="c2">
The New York Times
<br/>
</span>
...
</DOCFULL>
...
<DOCFULL> -->
<br/>
<div class="c0">
<p class="c1">
<span class="c2">
1 of 4 DOCUMENTS
So, somehow I need the following commands, once fulfilled, to again apply to the next article, that will start again will -->. But I just cannot get it to work the way needed. For example to extract 'The New York Times' in the partial html above I use, and it should automatically also been done to the 2nd/3rd/4th etc article.
journal = soup.find_all('span', class_='c2')[1].getText()
If anyone can point me in the direction I should start thinking it would be really appreciated!
EDIT:
Just to put more into perspective what I am trying to achieve. I can get the latter parts to work, but do not get it to check each article after the former.
For Each Article:
* Determine Newspaper
* If newspaper = x
.
.
.
* Else
Continue
I've reviewed https://stackoverflow.com/questions/5542428/why-on-earth-is-address-a-block-level-element already and found that it adds little insight to the matter.
A client gave me a paragraph of plain text, and I'm attempting to optimize it for both user experience and SEO. Here's the relevant snippet, from the middle of the text:
<p>[Several sentences]. Having trouble? Contact <address style="font-style:normal;display:inline">Jane Doe at jdoe#example.com or (555) 123-4567</address> between the hours of 9AM and 5PM. [Several sentences].</p>
However, since <address> is a block-level element, the DOM ends up looking like this:
<p>[Several sentences]. Having trouble? Contact </p>
<address style="font-style:normal;display:inline">Jane Doe at jdoe#example.com or (555) 123-4567</address>
between the hours of 9AM and 5PM. [Several sentences].<p></p>
and the output looks like this:
[Several sentences]. Having trouble? Contact
Jane Doe at jdoe#example.com or (555) 123-4567
between the hours of 9AM and 5PM. [Several sentences].
Obviously, this breaks the UX, and isn't valid HTML. My questions are What is the reasoning behind <address> being block-level only, and is there any way I can make it display inline? As you can see, the CSS display:inline attribute/value does nothing to help the situation
Why can't address elements be in p elements?
Because the HTML specification defines them that way.
The address element represents the contact information for its nearest article or body element ancestor. If that is the body element, then the contact information applies to the document as a whole.
What this means is that <address> elements aren't meant to be used to mark up any old address. The implication is that you'd be using the <address> as a means of contacting the source of the article. Within an article, discussing "123 fourth street" would not merit using an <address> element.
If you want to describe it as an address for styling purposes, you could always give it a class as:
<span class="address">123 fourth street</span>
Don't use the <address> element for generic addresses, instead use the Person schema with Microdata, or the hCard Microformat, or RDFa. Here's a example with Microdata:
<p itemscope itemtype="http://schema.org/Person">
[Several sentences]. Having trouble?
Contact <span itemprop="name">Jane Doe</span> at
<a itemprop="email" href="mailto:jdoe#example.com">jdoe#example.com</a>
or <a itemprop="telephone" href="tel:5551234567">(555) 123-4567</a>
between the hours of 9AM and 5PM.
[Several sentences].
</p>
You can test the data extraction with Google Webmaster Tools (scroll down to the section titled 'Extracted structured data').
I am trying to create an interface for emails. I want to import a picture but I can't do it without having cid. For example:
That works just fine. but i Can't seem to put the text to the left of the picture. Please look at the code below to get a better understanding!
<div style="background-color:black;">
<body style="font-color:white;">
<h1><i>Airline Credits</i></h1>
</br>
</ul>
Dear [FullName],<br/>
Thank you for your <i>Airline Credits</i> redemption. Below is a summary of your order:
<b>Order Date:</b>[OrderDate]<br/>
<b>Description:</b>[ItemName]
<br/><b>Redemption Amount:</b>[CostInPoints]
<br/><b>Order Tracking Number:</b>[OrderNumber]
<br/><br/>
<b>Please note:</b>
If you did not make this request, please contact us immediately at [AirlinePhoneNumber]. Our Customer Service Representatives are available to help you.
<br/><br/>
Please read the terms and conditions for Airline Credits Redemptions at [WebSiteAddress] about how you are provided your redeemed items. To view your Airline Credits balance, please click here
<br/>
<img src=cid:AirlineCredits.jpg/>
</body>
</div>
HTML email is pain - nothing inherent in it, but because Microsoft decided to make Outlook 2007, 2010, and 2013 use Word's horribly broken and poor HTML rendering implementation (whereas Outlook 2003 used IE's).
Outlook has poor floating box support, so I advise against it in this situation.
Anyway, ordinarily I'm a web-standards zealot - but in HTML email that doesn't really seem to matter, so I'd just say to use tables, like so:
<table border="0"> <!-- Tim Berners-Lee, forgive me, for I have sinned. -->
<tr>
<td>
<p>Please read the terms and conditions for Airline Credits Redemptions at [WebSiteAddress] about how you are provided your redeemed items. To view your Airline Credits balance, please click here</p>
</td>
<td> <img src=cid:AirlineCredits.jpg /> </td>
</tr>
</table>
Relatively painless, gets the job done.
(and causes me to die inside).