BeautifulSoup getting href [duplicate]

You can use find_all in the following way to find every a element that has an href attribute, and print each one: from BeautifulSoup import BeautifulSoup html=””‘<a href=”https://stackoverflow.com/questions/5815747/some_url”>next</a> <span class=”class”><a href=”another_url”>later</a></span>”’ soup = BeautifulSoup(html) for a in soup.find_all(‘a’, href=True): print “Found the URL:”, a[‘href’] The output would be: Found the URL: some_url Found the URL: … Read more

JSP tricks to make templating easier?

As skaffman suggested, JSP 2.0 Tag Files are the bee’s knees. Let’s take your simple example. Put the following in WEB-INF/tags/wrapper.tag <%@tag description=”Simple Wrapper Tag” pageEncoding=”UTF-8″%> <html><body> <jsp:doBody/> </body></html> Now in your example.jsp page: <%@page contentType=”text/html” pageEncoding=”UTF-8″%> <%@taglib prefix=”t” tagdir=”/WEB-INF/tags” %> <t:wrapper> <h1>Welcome</h1> </t:wrapper> That does exactly what you think it does. So, lets expand … Read more

jQuery autocomplete tagging plug-in like StackOverflow’s input tags? [closed]

In order of activity, demos/examples available, and simplicity: (demo) https://github.com/yairEO/tagify (demo) https://github.com/aehlke/tag-it (demo) https://ioncache.github.io/Tag-Handler/ (demo) http://textextjs.com/ (demo) https://github.com/webworka/Tagedit (demo) https://github.com/documentcloud/visualsearch/ (demo) http://harvesthq.github.io/chosen/ (this isn’t really a tagging plugin) (demo?) http://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ (demo?) http://jcesar.artelogico.com/jquery-tagselector/ (demo?) http://remysharp.com/wp-content/uploads/2007/12/tagging.php (demo?) http://pietschsoft.com/post/2011/09/09/Tag-Editor-Field-using-jQuery-similar-to-StackOverflow.aspx Related: https://meta.stackexchange.com/questions/100669/feedback-wanted-improved-tag-editor

ASP.NET “special” tags

The official name is “server-side scripting delimiters” or “ASP.NET inline expressions”. Visual Studio 2008 syntax highlighting settings dialog calls these “HTML Server-Side Script”. Microsoft guys call them “code nuggets” in their blogs. <%@ %> is a Directive for ASP.NET Web Pages. Used for pages and controls to configure page/control compiler settings (<%@ Control Inherits=”MyParentControl” %>). … Read more

Display HTML snippets in HTML

The tried and true method for HTML: Replace the & character with &amp; Replace the < character with &lt; Replace the > character with &gt; Optionally surround your HTML sample with <pre> and/or <code> tags.

tech