Sponsored Content
Top Forums Programming Python Web Page Scraping Urls Creating A Dictionary Post 302998744 by durden_tyler on Tuesday 6th of June 2017 03:48:16 PM
Old 06-06-2017
Quote:
Originally Posted by metallica1973
...
...
Would you happen to know how to delete duplicate entries inside of this embedded list?
...
...
Do not add a duplicate entry in the first place:

Code:
tut_links = {}
for subdir, dirs, files in os.walk('./html/tutorials/blah'):
    for tut in files:
        if tut.endswith(".html"):
            tut_links[tut] = []
            fpath = os.path.join("./html/tutorials/blah", tut)
            content = open(fpath, "r").read()
            file = BeautifulSoup(content, 'lxml')
            for links in file.find_all('a'):
                urls = links.get('href')
                if urls not in tut_links[tut]:
                    tut_links[tut].append(urls)

This User Gave Thanks to durden_tyler For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

making a web page

Hey im new to unix! I am tryin to create a web page in unix and have done it all but when i try and load it it says permission denied!?> i have chmod a+rx for folder and file to make sure but still permissions wont let me?! any ideas can anyone do a quick run through of how to make a web page... (4 Replies)
Discussion started by: shashora
4 Replies

2. UNIX for Dummies Questions & Answers

Accessing Web Page

Hello, I am new to unix, but wanted to know how can we fetch data from a web page (i.e. an HTML Page), my requirement is to read an html page and wanted to create a flat file (text file) based on the contents available in the mentioned HTML page. Thanks Imtiaz (3 Replies)
Discussion started by: Imtiaz
3 Replies

3. UNIX for Dummies Questions & Answers

how do i make a web page

hey uhh this is my first post and i was wondering how do i make a web page for like a small business or something anything will help thanks (3 Replies)
Discussion started by: Neil Peart
3 Replies

4. UNIX for Dummies Questions & Answers

Make a Web page

I'm 13 years of age and I am into computers. I am trying to learn how to make a webpage. I could use the help and I would greatly appriciate it. (1 Reply)
Discussion started by: lydia98
1 Replies

5. Programming

fetching a web page in C

Hello, I'm a total newbie to HTTP commands, so I'm not sure how to do this. What I'd like is to write a C program to fetch the contents of a html page of a given address. Could someone help with this? Thanks in advance! (4 Replies)
Discussion started by: rayne
4 Replies

6. Shell Programming and Scripting

Creating a dictionary with domain name adjuncted

Hello, I have created a dictionary which has the following structure: DOMAINWORD=(equivalent in English)gloss(es) in Hindi each separated by a comma(equivalent in English)gloss(es) in Hindi each separated by a comma or a semi-colon An example will make this clear ... (13 Replies)
Discussion started by: gimley
13 Replies

7. Shell Programming and Scripting

Counting all words that start with a capital letter in a string using python dictionary

Hi, I have written the following python snippet to store the capital letter starting words into a dictionary as key and no of its appearances as a value in this dictionary against the key. #!/usr/bin/env python import sys import re hash = {} # initialize an empty dictinonary for line in... (1 Reply)
Discussion started by: royalibrahim
1 Replies

8. Shell Programming and Scripting

Creating verbal structures from a dictionary and a template

My main aim here is to create a database of verbs in a language to Hindi. The output if it works well will be put up on a University site for researchers to use for Machine Translation. This because one of the main weaknesses of MT is in the area of verbs. Sorry for the long post but the problem... (4 Replies)
Discussion started by: gimley
4 Replies
LES(8)							       Maintenance Commands							    LES(8)

NAME
les, bus - ATM LAN Emulation service demons SYNOPSIS
lecs [-l listen_address] [-f configuration_file] [-d ] DESCRIPTION
LE Service consists of three components: LAN Emulation Configuration Server (lecs), LAN Emulation Server ( les(8)) and Broadcast and Unknown Server (bus(8)). Lecs implements the distribution of LECs to different emulated LANs. This is done by giving different LAN Emulation Server ATM addresses to LECs. Distribution is based on lecs's configuration database and information provided by the LE client. It is not required that a lecs exists for all emulated LANs. It is possible to bypass this configuration phase by directly telling ATM address of the les(8) to the LEC. Configuration file example for lecs: # Our ATM address (should be included to differentiate us from # e.g. LEC) # Must be before ELAN definitions 470023000000030300010002010020ea000ae905 # ELAN name is inside brackets. # Parameters below are for Ethernet type LE (Linux & almost all # other LE clients) [tut-lane1] # Address of the LES LES:=470023000000030300010002010020ea000ae901 # 802_3 or 802_5 (802_3 = Ethernet) Type:=802_3 # 1515, 4544, 9234 or 18190 (1516= Ethernet) Max_Frame:=1516 # ATM address for hosts that are guided to this ELAN. # Wildcard is x or X. 470023000000030300010002010020ea0005aax0 470023000000030000010002010020ea0005bx00 47.002300000003030001000201.00603E2FDX23.00 470023000000030300010002010020ea000Xxx00 DEFAULT # Another ELAN, which has empty name [asdf] # This directive sets this elan as the default i.e. it will be # included if LEC's configure request could not be matched to # other ELANs #DEFAULT LES= 470023000000030300010002010020ea000ae902 Type=Ethernet Rules for finding ELAN definitions using information provided in LE_CONFIGURE_REQUEST and the configuration file are as follows: 1. Find an entry where ELAN-NAME matches exactly and an ATM address of the LEC is found in ELAN definition. These are to match exactly with the information given in LE_CONFIGURE_REQUEST. If ELAN-NAME is found, but ATM address doesn't match then reject with reason "Permission denied". 2. Search for first ELAN which matches in type of emulated LAN, maximum frame size and ATM address of the LEC. 3. If matching ELAN was not found, return default ELAN definitions. 4. No match, so request is rejected with reason "No Configuration". SIGHUP restarts the server. OPTIONS
-d Reads the configuration file, dumps its contents and exits. -l listen_address Use the listen_address to where wait connections. -f configuration_file Use the specified configuration file instead of .lecs_conf. FILES
.lecs_conf configuration file BUGS
Undocumented. AUTHOR
Marko Kiiskila, TUT <carnil@cs.tut.fi> SEE ALSO
les(8), atmsigd(8), zeppelin(8) Linux Sep 11, 1996 LES(8)
All times are GMT -4. The time now is 11:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy