text
stringlengths
226
34.5k
NLTK was unable to find stanford-postagger.jar! Set the CLASSPATH environment variable Question: I am working on a project that requires me to tag tokens using nltk and python. So I wanted to use this. But came up with a few problems. I went through a lot of other already asked questions and other forums but I was stil...
Floating point decimals in python Question: I have a python script within which I define a variable called `dt` and initialize it as such: `dt=0.30`. For some specific reason, I have had to convert my python script into a C++ program, but the two programs are written to produce the exact same results. The problem is th...
SoftLayer API Hardware Order Options Specification Question: I am trying to order a couple of very specific node types, and am wondering how it would be possible to do this via the SoftLayer API. When running the command slcli server create-options or call the get_create_options() function in the Python API, I do not r...
Why does Python allow instance variables to be added after initialization? Question: class MyClass(object): class_var = [] def __init__(self, i_var): self.i_var = i_var a = MyClass(2) a.hit = 1 print a.hit As we can see, `hit` is added to `a` as an instance variab...
Returning 5 best cards containing a pair from a set of 7 playing cards using Python Question: I'm currently trying to use Python's Enum module on Python 2.7 to identify pair of cards from a hand of 7 import collections import operator import enum Card = collections.namedtuple("Card", "ra...
Proper way to run a PyCharm project Question: This is a seemingly simple problem but it proves to be harder than expected. I've created a project in pycharm in the following layout bin main helpers userhelper models user session tests userTest in...
Writing output csv file python Question: I'm trying to write a list into a csv file so that it's properly formatted. I've read from other stack overflow posts that below is the correct way to do so, (in order to preserve commas that I want to be printed out, etc), but this is just not working for me. Rather than print...
How to compare two .sql files in python? Question: I would like to compare the *.sql files in python and capture the difference in a new file (.sql file) Are there any packages in python which helps in performing the below tasks. For example: ### file_1.sql CREATE TABLE Persons ( PersonID i...
Download a file from GoogleDrive exportlinks Question: Trying to download a file directly using Python and the Google Drive API exportlinks response. 1. Suppose I have an export link like this: a) [https://docs.google.com/feeds/download/documents/export/Export?id=xxxx&exportFormat=docx](https://docs.google.com/feed...
How to save a plot in Seaborn with Python Question: I have a Pandas dataframe and try to save a plot in a png file. However, it seems that something doesn't work as it should. This is my code: import pandas import matplotlib.pyplot as plt import seaborn as sns sns.set(style='ticks') ...
IOError: [Errno 13] Permission denied How do I fix this? Question: Iam newbie to python and keep on getting this error when run this script, I have given full permission to the file. Traceback (most recent call last): File "/usr/local/bin/ftp_site.py", line 3, in <module> import ...
Python/Selenium: Whitespace issue when retrieving text content from XPath (normalize-space) Question: I am having some difficulties with a relative `XPath` web scraper implementation with `Selenium` for `Python`. From this [Börse Frankfurt web page](http://www.boerse-frankfurt.de/etp/db-x- trackers-STOXX-GLOBAL-SELECT...
Python Tkinter error object has no attribute Question: So I am making a program similar to the arcade games. I want the lableGuess to appear in the toplevel window after clicking the frame but it gives me this error: AttributeError: 'Window' object has no attribute 'window' Here's the code: from tkinte...
How subtotal rounding works in quotation for Odoo 8? Question: I face an inconsistent Subtotal rounding in Quotation. The quotation comes from external data (via import menu). My current Odoo version is 8. I have quantity 60 with 6 decimal precision and Unit Price 90.075600 with also 6 decimal precision (which is alre...
Python - unichr() - 'charmap' codec can't encode character Question: I would like to ask you for help. I have to decode unicode decimal to chars, but I am not decoding only clasisc letters, I am decoding special characters like: ؋,лв and some more ¥ and it doesn't work - it says : 'charmap' codec can't encode character...
Read a python variable in a shell script? Question: my python file has these 2 variables: week_date = "01/03/16-01/09/16" cust_id = "12345" how can i read this into a shell script that takes in these 2 variables? my current shell script requires manual editing of "dt" and "id". I want to read ...
Made a button class in python but cannot add to screen with pygame Question: import pygame, sys, time, random from pygame.locals import* pygame.init() class Button(object): def __init__(self, x, y): '''x_size, y_size,''' #self.name = name '''self.length =...
Create an Entry box if a specific item on Optionmenu is selected Question: i'm new to Python scripting. I'm trying to create an entry box for a user to manually input a variable that doesn't exist in a list of a optionmenu widget. is this possible? from Tkinter import * import Tkinter as tk ...
Unsuccessful post to asp.net form using Python requests Question: I am attempting to use Python requests to post a value to the "employer" form in the <http://www.myvisajobs.com/Search_Visa_Sponsor.aspx?N=> This is what I have tried so far in Python: import requests url = "http://www.myvisajobs.com/...
Executing script with sudo in virtual environment - packages not found Question: I created a virtual environment and wrote a Scapy project in it. For this I wrote some modules and packages and put them in the environments site-packages folder. Now when I enter the environment with `source bin/activate` and try to execu...
How to import argparse when I am using qsub in Linux server? Question: I want to use CoNIFER, which is a python program for bioinformatics. So, I wrote a script for qsub because of my institute's rule. Here is my qsub script. I inserted enter in front of -- to show it clear. #!/bin/bash #$ -N oh ...
py2exe missing modules: oauth2client.client and gspread modules Question: I have created the following Python script using the gspread and oauth2 modules import gspread from oauth2client.client import SignedJwtAssertionCredentials credentials = SignedJwtAssertionCredentials("client_email","p...
Python Minidom Parsing File Objects Question: I wrote a code using minidom which takes an `xml` script, opens it as a file object and then parses that file object. Not only that, but I want the script to open multiple files that are all contained in a folder, and parse each one individually. An example of the `xml` sc...
pass vim argument in completefunc Question: I am writing a `vimscript` that uses `completefunc` as: " GetComp: Menu and Sunroutine Completion {{{1 function! GetComp(arg, findstart, base) if a:findstart " locate the start of the word let line = getline('.') let start = col(...
selenium: webdriver.PhantomJS(): "Error: Can not connect to GhostDriver on port 51263" Question: I want to use PhantomJS() in python3.4 and typed Therefore: from selenium import webdriver browser = webdriver.PhantomJS() I got the error: Traceback (most recent call last): F...
Changing BASH script to Python Question: I am trying to convert this script to Python but am having problems with the BASH syntax `${variable}`. This does something I do not understand as I have very little experience with BASH scripting. My question is basically,how can I do the dollar brackets variable thing in Pytho...
How to slice and access text with TkInter's indices? Question: In Python, to slice a string to use indices, e.g. word = "Python" # immutable string word[2:5] # characters from position 2 (included) to 5 (excluded) outputs `'tho'` The Text Widget for TkInter outputs text location at ...
lxml: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Question: I've seen some posts on lxml installing problems, but none of the answers I found was of any help. Many said to install python-dev, libxml2 and libxslt to solve the problem. They are already installed, but I still get the following outcome ...
Webview or iframe in django python Question: How to put an iframe, or something similar(like a webview), in my website such that the request for the iframe is sent from server side instead of client browser? I am using django in backend. I want to use iframes for viewing of regular sites like google.com. Answer: if y...
How to source script via python Question: I can source bash script (without shebang) easy as bash command in terminal but trying to do the same via python command sourcevars = "cd /etc/openvpn/easy-rsa && . ./vars" runSourcevars = subprocess.Popen(sourcevars, shell = True) or sou...
Downloading a file served by a tornado web server Question: This is how I have my tornado web server currently defined: application = tornado.web.Application([ tornado.web.url(r"/server", MainHandler), tornado.web.url(r"/(.*)", tornado.web.StaticFileHandler, { "path": scriptpath, "defaul...
python stream subprocess stdout and stderr zip doesnt work Question: There are already a bunch of answers that solve how to do this general thing, but my main question is Why doesnt this approach work? I am trying to "live stream" the stdout and stderr from a subprocess. I can do this by doing: import s...
Directory Structure for Importing Python Package using __init__.py Question: I've got a python project (projectA), which I've included as a git submodule in a separate project (projectB) as a subfolder. The structure is laid out as projectB/ projectB_file.py projectA/ (repository) ...
Plot a line graph over a histogram for residual plot in python Question: I have created a script to plot a histogram of a NO2 vs Temperature residuals in a dataframe called nighttime. The histogram shows the normal distribution of the residuals from a regression line somewhere else in the python script. I am struggli...
Error with the function random.choice Question: Using this code: from PIL import Image from PIL.ImageChops import subtract import numpy import math import time import glob import sys import os import logging import random def GreenScreen(infile, inbg ,out...
access host class from IronPython script (lightswitch) Question: I'm new at this, so I hope the question is well formed enough for someone to understand what i'm asking, if not I'm happy to add more detail. I am trying to reference a variable defined on the server side of a lightswitch application from a python script....
How can I remove a date in the format of ##/##/#### from a string in Python? Question: I have a text file that have strings that start with the date in the form of ##/##/#### and I want to remove the date and keep to work with the rest of the text that is in that line. I have been look at regular expressions but cannot...
re module has no attribute compile Question: I am trying to use the following command in Python 3: text = re.compile('attribute') but it tells me that that 're module has no attribute compile'. Has the command been updated in Python 3? Answer: You can debug such scenario by using `imp.find_module...
beginner python web scrape issue Question: I have the following html code: <div class="panel panel-default box"> <div class="panel-heading"> <h2 class="panel-title">December 2015</h2> </div> <div class="panel-body"> <ul> <li>December 30, 2015 - <a href="link">Report</a></li> ...
execute hello world with flask "ImportError: No module named flask" Question: I'm trying to use flask and python. I did a simple file named `hello.py`. tHis file contains this code: from flask import Flask app = Flask(__name__) @app.route("/") def main(): return "Welcome!" ...
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 0: unexpected end of data Question: I'm writing a code for stemming a tweet, but I'm having issues with encoding. When I tried to apply porter stemmer it shows error.Maybe i m not able to tokenize it properly. My code is as follows... i...
opencv find centre of face in facedetction Question: I need to find the centre of a rectangle that gets put around a face when it's detected in OpenCV. I am using Python in Visual Studio. Here is the code I am running: * * * #!/usr/bin/env python from cv2 import * import sys c...
Maya Python script to show numerical vertex translation Question: I want to write a script for Maya in Python which allows you to see the numerical translation of a Vertex in a headup display. So if a pick one Vertex and move it along an axis, in the headup display should appear the moved value since the start world p...
how do I disply an np.array in column with xlwings Question: I have the following code in python with xlwings @xlfunc @xlarg('x', 'nparray', ndim=1) @xlarg('y', 'nparray', ndim=1) def test_sum(x,y): return(x+y) Once in excel, I submit ctrl+shift+Enter but it displays the result ...
How to post a term with brackets with PHP to Sympy Question: I want to post a term like 5+(x+4) from PHP via Python to Sympy in order to simplify the expression. For that I'm using folowing code: PHP: $param="5+(x+4)"; $command="python $PathToPySkript $param"; //# '$param2' '$pa...
Python Permutation taken at a time Question: I wrote nested loops to give me all posible permutations of all letter of alphabet taken 4 letters at a time. def permutation(): import string alphabet = string.ascii_lowercase perm = [] for item1 in alphabet: ...
Python send a command to Xterm Question: I have a python script that opens up file for me in emacs, and to do that it calls a process in xterm like so """AutoEmacs Document""" # imports import sys import os import psutil import subprocess from argparse import ArgumentParser ...
Calling C++ from python using boost python: introductory example not working Question: I am interested in using Boost.Python to call C++ functions from my Python scripts. This example [here](http://www.boost.org/doc/libs/1_60_0/libs/python/doc/html/tutorial/index.html#tutorial.quickstart) is an introductory example on...
how to create a list sequence in python containing all possible pairs an equal number of times? Question: Given the letters `x,y` is there a way to write a python function that returns a list sequence containing all possible pairs (`[x,x], [x,y], [y,x], [y,y]`) an equal number of times? for example can I write a funct...
Python: Trying to access different dictionaries in an imported file, based on variable given Question: I have been making a simple turn based 'board game' in python using a separate file to hold all of the data, such as what the attributes of a space is and the attributes of the players. All of this is stored in separa...
How to use trailing rows on a column for calculations on that same column | Pandas Python Question: I'm trying to figure out how to compare the element of the previous row of a column to a different column on the current row in a Pandas DataFrame. For example: data = pd.DataFrame({'a':['1','1','1','1','1...
Python mechanize or any other library to login into google to read groups Question: I am trying to read google groups so it is expecting to login into google account. I used Mechanize for that but I am getting SSL verification error from mechanize import Browse br=Browse() br.set_handle_equiv(Tr...
Nested for loops to recursive function in Python Question: I have three lists, each one with several possible values. probs = ([0.1,0.1,0.2], \ [0.7,0.9], \ [0.5,0.4,0.1]) I want to test all possible combinations of choosing one element from each list. So, 3*2*3=18 possibl...
How to run pip of different version of python using python command? Question: I'm now currently using Python on ubuntu 15.10 But in my OS, I have many different python version installed: * Python (2.7.9) * Python3 (3.4.3) * Python3.5 * PyPy So, I got mess about the version of their package environment, for ...
Preferred way to resolve package root in Python Question: I am aware of the following way to determine the directory in which a module is executing: os.path.dirname(os.path.abspath(__file__)) Now let's say I have a package with some modules that need to read a text file located in a subdirectory. S...
Why do imports fail in setuptools entry_point scripts, but not in python interpreter? Question: I have the following project structure: project |-project.py |-__init__.py |-setup.py |-lib |-__init__.py |-project |-__init__.py |-tools.py with `project.py`:...
SWIG wrapping issues with C++ --> python Question: I'm trying to wrap a C++ file that depends on another C++ file (global.cpp) by using SWIG. I was able to get the first one to work fine, but this nested dependence seems to cause an issue. Here is my setup: ## position.i %module position %include gl...
Downloading url content using BeautifulSoup in Python Question: > None Type Object Has No attribute text. Line 16 from bs4 import BeautifulSoup, SoupStrainer try: import urllib.request as urllib2 except ImportError: import urllib2 import re def main(): opener =...
Comparing two text files in python and print the difference in two files with command run on the device Question: I am new to Python. I had written the script to fetch the data from juniper devices and output is like: Output contains output data from show version and this command is included as well.I am fine until th...
cx_freeze converted GUI-app (tkinter) crashes after presssing plot-Button Question: I've been dealing with this for days now and hope to finde some help. I developed a GUI-application with imported modules tkinter, numpy, scipy, matplotlib, which runs fine in python itself. After having converted to an *.exe everything...
how to include PyOpenSSL in a python package Question: I need to deploy an application on AWS Lambda in python . This app is based on Google API SDK, which require a crypto library such as pyOpenSSL. But, contrary to other libs which are included in my package by doing something like this : pip install m...
how run pybottle in vagrant Question: I have this Vagrant file # encoding: utf-8 # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" config.ssh.forward_agent = true config.vm.boot_timeout = 300 conf...
Where can I find the admin code for uploading an image in django? Question: I'm currently coding an image upload in a view and I want to compare it to the code the admin uses for uploading images. Is there code the admin generates the file forms from? **Where can I find the python code to an admin image/file upload?** ...
Processing objects of different classes in Python in parallel Question: I have 6 different classes. In main, I am creating one object of each class. I want to call `eachObject.processFiles()` of each object parallely. The processFiles method processes the object files by reading them, manipulates the data, and save ...
How do I pass function definition to python script as string Question: I want to pass **function definition** to a python command line script. What is the best way to do this? I am using python 2. Suppose i have a script like this: #myscript.py x = load_some_data() my_function = load_function_def...
User input from GUI in Python 3.5 Question: So, I'm pretty new to Python, but I am having trouble handling the variables once they are placed in a class. The following code works fine when there is no surrounding class, but once I add it I get the error: NameError: name 'someName' is not defined W...
How to replace values in an attribute table for one column? Question: I need to replace values in an attribute table for one column (replace zeroes in column named "label" to 100). Is this possible using ogr or python? I have to do this for 500+ shapefiles. Answer: In the Esri ArcGIS realm, [Update Cursors](http://re...
Python and Pandas - Removing footer in multiple files with the same break Question: I am doing data analysis on a group of different excel files, each with a footer. The start point of the footer changes based on the total number of rows. The footer starts in the first column as a blank cell then has text that is not f...
Python Tkinter: Have Entry receive keys while Menu is posted? Question: I want to have an Entry with a dropdown Menu autocomplete... kind of like Chrome's omnibar, for example. One issue I'm having is that once the menu gets posted (displayed), it seems to intercept all key press events, and I don't see a way to redir...
Python Multithread and PostgreSQL Question: I want to speed up one of my tasks and I wrote a little program: import psycopg2 import random from concurrent.futures import ThreadPoolExecutor, as_completed def write_sim_to_db(all_ids2): if all_ids1[i] != all_ids2: c.exe...
How to create a new MSMQ message in IronPython with label, reply queue and other properties Question: I'm following this example [here](http://www.ironpython.info/index.php?title=Message_Queuing) to use MS Message Queues with IronPython. The example works to create a message text string without any properties. ...
Formatting data for hmmlearn Question: I'm trying to fit a hidden Markov model using hmmlearn in python. I assume that my data is not formatted correctly, however the documentation is light for hmmlearn. Intuitively I would format the data as a 3 dimensional array of n_observations x n_time_points x n_features, but hmm...
dictionary inside 2 loops to save to a single file Question: I intend to write in a single file (for each function), but inside the "loop in the loop" I got trapped. It's working except the storage/ save part, now writes a file for each inner loop: ## def t2(): ## But I wish to improve and also work with the current ...
import wpf to IronPython app Question: I'd like making IronPython WPF app' but VS says: > "ImportError: No module named 'wpf' " I tried [this link](http://stackoverflow.com/questions/27580543/importerror- no-module-named-wpf-in-revit-environment-only-user- interface/27599805#27599805) but it doesn't work. I am not su...
How to scrape using Python a link from a html class Question: I am attempting to grab the link from the website. Its the sound of the word. The website is <http://dictionary.reference.com/browse/would?s=t> so I am using the following code to get the link but it is coming up up blank. This is weird because I can use a ...
Python split string that have two delimited Question: I want to know how to split a string with more then one delimiter. I have a problem splitting if one is space? I trying to read a text file that has this: > 22.0;2016-01-16 00:16:18 I know how to read a text file to a variable, but when I have problem to split ev...
how to display huge data in new excel sheet using python Question: from openpyxl import load_workbook wb=load_workbook('Project_Python.xlsx') sheet2=wb.get_sheet_by_name('Sheet2') sheet3=wb.get_sheet_by_name('Sheet3') sheet1=wb.get_sheet_by_name('Sheet1') ...
AttributeError in python3 Question: I want to adapt [this code](http://rosettacode.org/wiki/Vigen%C3%A8re_cipher/Cryptanalysis#Python) to work in persian text. I changed it as can be seen in the code bellow in which the `english_frequency` and `ordA` are changed. But, it has an error with `uppercase` in line: ...
Python Urllib Query Question: I am thinking through how to expand this script to get it to repeatedly download the next 20 files but am stuck. Any hints? import urllib fhand = urllib.urlopen('http://ecorp.azcc.gov/Search/Details?Request.Term=1&Request.IsActive=True&Request.Type=StartsWith&Request.Cat...
Python script, log to screen and to file Question: I have this script, and I want now to put the output on screen and into a log file. Anyone who can help me on how to do this? PS: don't mind my debug lines plz Thx #!/usr/bin/python import os import subprocess import sys impor...
How to scrape google? Question: So I wanna scrape google, I have successfully scraped craigslist using this method but I can't seam to scrape google for some reason (yes of course I changed the class and stuff..) this is what I want to scrape: I want to scrape websites description: [![image](http://i.stack.imgur.com/...
Is there a way to get function parameter names, including bound-methods excluding `self`? Question: I can use `inspect.getargspec` to get the parameter names of any function, including bound methods: >>> import inspect >>> class C(object): ... def f(self, a, b): ... pass ....
Celery (Django + Redis) task fails: "No connection could be made because the target machine actively refused it" Question: **UPDATE:** I decided to try using Django as the broker for simplicity, as I assumed I did something wrong in the Redis setup. However, after making the changes described in the [docs](http://docs....
Download a file in python with urllib2 instead of urllib Question: I'm trying to download a tarball file and save it locally with python. With urllib it's pretty simple: import urllib urllib2.urlopen(url, 'compressed_file.tar.gz') tar = tarfile.open('compressed_file.tar.gz') print ta...
HTTP Error 406: Not Acceptable Python urllib2 Question: I get the following error with the code below. > HTTP Error 406: Not Acceptable Python urllib2 This is my first step before I use beautifulsoup to parse the page. import urllib2 opener = urllib2.build_opener() opener.addheaders = [('User-a...
How do I install and use MySQLdb for Python 3 on Windows 10? Question: My various searches seem to come up with very old posts or a mention of how to do this under cygwin. I had python 3.5 installed and then installed Anaconda3. I have python 3.5 (Cpython) installed in my user directory. I tried changing the order of h...
How to get the final redirected URL which has some JavaScript's? Question: I used urllib2 to get the final redirected url of a web-link. For eg: <http://tbk.bz/t72qx4v3> I am getting link as <http://taskbucks.com/artcl_out?artcl=24713df2ffb748ec8464638df61d2298> But, browsers gave the redirected final URL like this www...
To gain function the button for generating values Question: The python code I've pasted below generates the values 0 through 100 and displays them in a textbox-like shell console. In addition to this, I added a button deep of textbox labelled 'PRESS'. I would like the process of generating the values 0 through 100 to b...
Create column of categories from a column of transactions using regular expressions within a dictionary Question: I have a csv file containing banking information that I am importing as a pandas DataFrame. I want to create a new column that contains the transaction categories (e.g. income, expense, transfer), created f...
Why does the Python runtime handle warnings this way? Question: Here's a traceback from a project I'm working on: /usr/lib/python3/dist-packages/apport/report.py:13: PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses i...
Dictionary order causing input result to change? Question: New here, and very new to Python. Go easy on me. I've got a .bat which allows a user to enter an IP or hostname which if valid will ping the target and then allow some actions to be performed. However, it's fairly inflexible and I think I've reached the limit o...
KeyError: global not accessible through external Class Question: I am trying to calculate the number of elements in a chemical equation. The debugger that I have created somehow doesn't work with outside variables. I am unsure of how to use globals in this situation. **EDIT:** The debugger is supposed to show the vari...
python tuple with missing entry Question: I am trying to parse a `bibtex` file with `python3`'s `bibtexparser` module. A sample bibtex file is: @article{ebert2013, Title={First-principles calculation of the Gilbert damping parameter via the linear response formalism with application to magnetic tr...
Why am I getting TypeError: unsupported operand types for -: 'float' and 'function'? Question: This is my code: def concfunction(time,k): return 0.1*exp((-k)*(time)) from scipy.optimize import curve_fit curve_fit(concfunction,time,k,p0=[10]) Where I've already got arrays for ti...
Using boto to connect to pre-existing windows instance Question: My code is the folliwing import boto.ec2 conn = boto.ec2.connect_to_region("us-west-2",aws_access_key_id='secret1',aws_secret_access_key='secret2') conn.run_instances( 'i-41ffc2c0', key_na...
Python write random integers to file on newline Question: I need to make a program that generates 10 random integers between 10 and 90 and calls two separate functions to perform separate actions. The first one (`playlist`) simply needs to print them all on one line without spaces, which was easy. The second one (`save...
Extracting raw data from a PowerPivot model using Python Question: What seemed like a trivial task turned into a real nightmare when I had to read some data from a PowerPivot model using Python. I believe I've researched this very well over the last couple of days but now I hit a brick wall and would appreciate some he...
MultiThreading/Optimization Python Requests? Question: I am trying to optimize this code, as of right now it runs 340 Requests in 10 mins. I have trying to get 1800 requests in 30 mins. Since I can run a request every second, according to amazon api. Can I use multithreading with this code to increase the number of run...
What exactly does 'use_idf' do when creating a TfidfTransformer in sklearn? Question: I am using the TfidfTransformer from the sklearn package in Python 2.7. As I was getting comfortable with the arguments, I became a bit confused about `use_idf`, as in: `TfidfVectorizer(use_idf=False).fit_transform(<corpus goes here...
Regex in lxml for python Question: I having trouble implementing regex within xpath command. My goal here is to download the html contents of the main page, as well as the contents of all hyperlinks on the main page. However, the program throws exceptions because some of the href links do not connect to anything (ex. '...