Sponsored Content
Top Forums Programming [Python] BeautifulSoup tags > </a> Post 303039708 by Neo on Saturday 12th of October 2019 08:20:27 PM
Old 10-12-2019
This should work, according to the docs (untested):

Code:
from bs4 import BeautifulSoup
markup = '<a href="https://unix.com/">The Student [2017].mp4</a>'
soup = BeautifulSoup(markup)

tag = soup.a
tag.string
# The Student [2017].mp4

Tweak as you see fit .....

Ref:

Beautiful Soup Documentation — Beautiful Soup 4.4.0 documentation
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

what is python?

I heard that its a new programming language but ill like to get a deeper explaination of it. (1 Reply)
Discussion started by: kprescod4158
1 Replies

2. Programming

Python: bash-shell-like less functionality in the python shell

Hello, Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells? Example: >>> import subprocess >>> help(subprocess) ... ... I'm hoping so as I hate scrolling and love how less works with... (0 Replies)
Discussion started by: Narnie
0 Replies

3. Programming

Help with Python. Please and thanks.

Hi everybody, I've been experimenting with Python lately and for the most part it's been a smooth ride. I have one little problem that maybe one of you can help me with. PROBLEM: I have list with one word per line. EXAMPLE apples oranges pears grapes etc... I also have a shell... (2 Replies)
Discussion started by: o0110o
2 Replies

4. SuSE

"ssh suse-server 'python -V' > python-version.out" not redirecting

Okay, so I have had this problem on openSUSE, and Debian systems now and I am hoping for a little help. I think it has something to do with Python but I couldn't find a proper Python area here. I am trying to redirect the output of "ssh suse-server 'python -V'" to a file. It seems that no matter... (3 Replies)
Discussion started by: Druonysus
3 Replies

5. UNIX for Dummies Questions & Answers

Python...

Hi all... Not sure where to put this so I put it here... All comments welcome... 1) Is the Python language now considered a part of the *NIX transient command structure much like Perl, (and awk)? 2) If so which OSes now have it as part of a "default" install - NOT an extra to be... (5 Replies)
Discussion started by: wisecracker
5 Replies

6. Shell Programming and Scripting

**python** unable to read the background color in python

I am working on requirement on spreadsheet in python scripting. I have a spreadsheet containing cell values and with background color. I am able to read the value value but unable to get the background color of that particular cell. Actually my requirement is to read the cell value along... (1 Reply)
Discussion started by: giridhar276
1 Replies

7. Shell Programming and Scripting

Python BeautifulSoup Re Finding Digits Within Tags

I am writing a little python script that needs to grab version numbers between "<td>4.2.2</td>" within the tbody of the page: blah blah blah blah blah Is it possible to use a one-liner to scrap only the digits between the tags: "<td>4.2.2</td>" so it spits out: 4.2.2 4.2.1 etc..... (2 Replies)
Discussion started by: metallica1973
2 Replies

8. Windows & DOS: Issues & Discussions

How to execute python script on remote with python way..?

Hi all, I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine.. Below is the code I am trying: #!/usr/bin/env python import wmi c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies

9. Programming

Create a C source and compile inside Python 1.4.0 to 3.7.0 in Python for ALL? platforms...

Hi all... As you know I like making code backwards compatible for as many platforms as possible. This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
Discussion started by: wisecracker
1 Replies
docidx_lang_cmdref(n)						Documentation tools					     docidx_lang_cmdref(n)

__________________________________________________________________________________________________________________________________________________

NAME
docidx_lang_cmdref - docidx language command reference SYNOPSIS
comment plaintext include filename index_begin text title index_end key text lb manpage file text rb url url label vset varname value vset varname _________________________________________________________________ DESCRIPTION
This document specifies both names and syntax of all the commands which together are the docidx markup language, version 1. As this docu- ment is intended to be a reference the commands are listed in alphabetical order, and the descriptions are relatively short. A beginner should read the much more informally written docidx language introduction first. COMMANDS
comment plaintext Index markup. The argument text is marked up as a comment standing outside of the actual text of the document. Main use is in free- form text. include filename Templating. The contents of the named file are interpreted as text written in the docidx markup and processed in the place of the include command. The markup in the file has to be self-contained. It is not possible for a markup command to cross the file bound- aries. index_begin text title Document structure. The command to start an index. The arguments are a label for the whole group of documents the index refers to (text) and the overall title text for the index (title), without markup. The label often is the name of the package (or extension) the documents belong to. index_end Document structure. Command to end an index. Anything in the document coming after this command is in error. key text Index structure. This command adds the keyword text to the index. lb Text. The command is replaced with a left bracket. Use in free-form text. Required to avoid interpretation of a left bracket as the start of a markup command. Its usage is restricted to the arguments of other markup commands. manpage file text Index structure. This command adds an element to the index which refers to a document. The document is specified through the sym- bolic name file. The text argument is used to label the reference. Symbolic names are used to preserve the convertibility of this format to any output format. The actual name of the file will be inserted by the chosen formatting engine when converting the input. This will be based on a mapping from symbolic to actual names given to the engine. rb Text. The command is replaced with a right bracket. Use in free-form text. Required to avoid interpretation of a right bracket as the end of a markup command. Its usage is restricted to the arguments of other commands. url url label Index structure. This is the second command to add an element to the index. To refer to a document it is not using a symbolic name however, but a (possibly format-specific) url describing the exact location of the document indexed here. vset varname value Templating. In this form the command sets the named document variable to the specified value. It does not generate output. I.e. the command is replaced by the empty string. vset varname Templating. In this form the command is replaced by the value of the named document variable BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category doctools of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
docidx_intro, docidx_lang_faq, docidx_lang_intro, docidx_lang_syntax KEYWORDS
docidx commands, docidx language, docidx markup, markup, semantic markup CATEGORY
Documentation tools COPYRIGHT
Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net> doctools 1.0 docidx_lang_cmdref(n)
All times are GMT -4. The time now is 06:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy