Sponsored Content
Top Forums Programming extract the username and the url and print it using Python 3 and BeautifulSoup 4 Post 303045303 by balajesuri on Monday 16th of March 2020 05:08:35 AM
Old 03-16-2020
I see that "text" is basically a dictionary. So you can convert the object type from str to dict; loop over the keys and print only the key-value pairs you need.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED extract url - please help a lamer

Hello everybody. I have lines that looks something like this: <done16=""118"" done18=""$ title=""thisisatitle"" href=""/JoeBanana" alt=""Joe""><done16=""118"" done18=""$ title=""thisisatitle"" href=""/GeraldGiraffe" alt=""Gerald""> What kind of SED command would I need to use to extract... (4 Replies)
Discussion started by: digi
4 Replies

2. Shell Programming and Scripting

How to extract url from html page?

for example, I have an html file, contain <a href="http://awebsite" id="awebsite" class="first">website</a>and sometime a line contains more then one link, for example <a href="http://awebsite" id="awebsite" class="first">website</a><a href="http://bwebsite" id="bwebsite"... (36 Replies)
Discussion started by: 14th
36 Replies

3. Shell Programming and Scripting

help, extract username from file

there is a text file like this text here text here text here text here USER=someusername here text here text here text here how can i extract the someusername from this file which has a path like /home/myfile.txt? i want to store it in a variable $u (3 Replies)
Discussion started by: vanessafan99
3 Replies

4. UNIX for Dummies Questions & Answers

Awk: print all URL addresses between iframe tags without repeating an already printed URL

Here is what I have so far: find . -name "*php*" -or -name "*htm*" | xargs grep -i iframe | awk -F'"' '/<iframe*/{gsub(/.\*iframe>/,"\"");print $2}' Here is an example content of a PHP or HTM(HTML) file: <iframe src="http://ADDRESS_1/?click=5BBB08\" width=1 height=1... (18 Replies)
Discussion started by: striker4o
18 Replies

5. UNIX for Dummies Questions & Answers

Launch a URL,validate username and password using wget or curl

Hi All, I want to launch "ex: http://gmail.com" from the cmd window and validate the credentials with username and password, is it possible? I have found something like this "wget --http-user=USER' --http-password=PASSWORD http://gmail.com" am new to this and unable to find a solution, i... (0 Replies)
Discussion started by: harsha85
0 Replies

6. UNIX for Dummies Questions & Answers

Mailx: extract username from a file

Hey guys, I am trying to send email to the usernames listed in a ascii file. I know about the .mailrc file. I want to know if I there is a way to extract the usernames from a file and email them. I tried something like this: mailx -s "subject" '~cat... (2 Replies)
Discussion started by: Nirav4
2 Replies

7. Shell Programming and Scripting

Newbie Python Url Scraper

I setup Zoneminder and have been playing around with setting up a couple of Wanscam PTZ ip cameras in which I have been running into road blocks with streaming and etc. I cant find much information on the camera and its webserver that sits on it and wanted to get a an absolute directory structure... (5 Replies)
Discussion started by: metallica1973
5 Replies

8. Shell Programming and Scripting

Connect to Remote DB2 ,using URL ,username,Password

Hi All, I am new to Shell scripting, I want to connect to DB2 database through URL,username and password Please help me out. I read so many posts in that there is no where it is mentioned about how to connect to a remote database. Thanks in advance :) (0 Replies)
Discussion started by: Rohit G
0 Replies

9. 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

10. Programming

[Python] BeautifulSoup tags > </a>

using BeautifulSoup how can i get the txt between all the > </a> example >The Student .mp4</a> thanks (10 Replies)
Discussion started by: bob123
10 Replies
PROP_DICTIONARY_UTIL(3) 				   BSD Library Functions Manual 				   PROP_DICTIONARY_UTIL(3)

NAME
prop_dictionary_util, prop_dictionary_get_dict, prop_dictionary_get_bool, prop_dictionary_set_bool, prop_dictionary_get_int8, prop_dictionary_get_uint8, prop_dictionary_set_int8, prop_dictionary_set_uint8, prop_dictionary_get_int16, prop_dictionary_get_uint16, prop_dictionary_set_int16, prop_dictionary_set_uint16, prop_dictionary_get_int32, prop_dictionary_get_uint32, prop_dictionary_set_int32, prop_dictionary_set_uint32, prop_dictionary_get_int64, prop_dictionary_get_uint64, prop_dictionary_set_int64, prop_dictionary_set_uint64, prop_dictionary_get_cstring, prop_dictionary_set_cstring, prop_dictionary_get_cstring_nocopy, prop_dictionary_set_cstring_nocopy, prop_dictionary_set_and_rel -- dictionary property collection object utility functions LIBRARY
Property Container Object Library (libprop, -lprop) SYNOPSIS
#include <prop/proplib.h> bool prop_dictionary_get_dict(prop_dictionary_t dict, const char *key, prop_dictionary_t *dictp); bool prop_dictionary_get_bool(prop_dictionary_t dict, const char *key, bool *valp); bool prop_dictionary_set_bool(prop_dictionary_t dict, const char *key, bool val); bool prop_dictionary_get_int8(prop_dictionary_t dict, const char *key, int8_t *valp); bool prop_dictionary_get_uint8(prop_dictionary_t dict, const char *key, uint8_t *valp); bool prop_dictionary_set_int8(prop_dictionary_t dict, const char *key, int8_t val); bool prop_dictionary_set_uint8(prop_dictionary_t dict, const char *key, uint8_t val); bool prop_dictionary_get_int16(prop_dictionary_t dict, const char *key, int16_t *valp); bool prop_dictionary_get_uint16(prop_dictionary_t dict, const char *key, uint16_t *valp); bool prop_dictionary_set_int16(prop_dictionary_t dict, const char *key, int16_t val); bool prop_dictionary_set_uint16(prop_dictionary_t dict, const char *key, uint16_t val); bool prop_dictionary_get_int32(prop_dictionary_t dict, const char *key, int32_t *valp); bool prop_dictionary_get_uint32(prop_dictionary_t dict, const char *key, uint32_t *valp); bool prop_dictionary_set_int32(prop_dictionary_t dict, const char *key, int32_t val); bool prop_dictionary_set_uint32(prop_dictionary_t dict, const char *key, uint32_t val); bool prop_dictionary_get_int64(prop_dictionary_t dict, const char *key, int64_t *valp); bool prop_dictionary_get_uint64(prop_dictionary_t dict, const char *key, uint64_t *valp); bool prop_dictionary_set_int64(prop_dictionary_t dict, const char *key, int64_t val); bool prop_dictionary_set_uint64(prop_dictionary_t dict, const char *key, uint64_t val); bool prop_dictionary_get_cstring(prop_dictionary_t dict, const char *key, char **strp); bool prop_dictionary_set_cstring(prop_dictionary_t dict, const char *key, const char *str); bool prop_dictionary_get_cstring_nocopy(prop_dictionary_t dict, const char *key, const char **strp); bool prop_dictionary_set_cstring_nocopy(prop_dictionary_t dict, const char *key, const char *strp); bool prop_dictionary_set_and_rel(prop_dictionary_t dict, const char *key, prop_object_t obj); DESCRIPTION
The prop_dictionary_util family of functions are provided to make getting and setting values in dictionaries more convenient in some applica- tions. The getters check the type of the returned object and, in some cases, also ensure that the returned value is within the range implied by the getter's value type. The setters handle object creation and release for the caller. The prop_dictionary_get_cstring() function returns dynamically allocated memory. See prop_string(3) for more information. The prop_dictionary_get_cstring_nocopy() and prop_dictionary_set_cstring_nocopy() functions do not copy the string that is set or returned. See prop_string(3) for more information. The prop_dictionary_set_and_rel() function adds the object to the dictionary and releases it. The object is also released on failure. RETURN VALUES
The prop_dictionary_util getter functions return true if the object exists in the dictionary and the value is in-range, or false otherwise. The prop_dictionary_util setter functions return true if creating the object and storing it in the dictionary is successful, or false other- wise. SEE ALSO
prop_bool(3), prop_dictionary(3), prop_number(3), proplib(3) HISTORY
The proplib property container object library first appeared in NetBSD 4.0. BSD
August 7, 2011 BSD
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy