![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#81 |
|
Hobbyist Programmer
Join Date: May 2006
Posts: 127
Rep Power: 3
![]() |
yeah I figured that it had something to do with the server moreso than the code, because it's running well again... I can't explain how much I appreciate your help
out of curiousity? DDOSing? |
|
|
|
|
|
#82 | ||
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
Quote:
def get_industry_urls(industry_page):
soup = BeautifulSoup(urlopen(industry_page))
links = soup.fetch("table")[7].fetch("a")
return [a['href'] for a in links if a.string != "Alphabetical"] |
||
|
|
|
|
|
#83 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
It's also common courtesy not to stress other people's servers. Put in a sleep(1) in the loop and you'll be being a lot more polite. Malicious computer users deliberately try to take too much bandwidth from other servers. This can cause servers to go down under the strain, which means the company will lose business. This is called a Denial of Service attack, or a DOS attack. When a denial of service attack comes from many different computers, it's called a distributed denial of service attack, or a DDOS attack. Also, look up try/except blocks in the Python tutorial. That information will come in handy later. |
|
|
|
|
|
|
#84 |
|
Hobbyist Programmer
Join Date: May 2006
Posts: 127
Rep Power: 3
![]() |
okay, I have to look that up but for now I'm going to cheat and just use it. I'll take a look at it a little later tonight, but since you're 6 hours ahead (UK right?), I want to get my final question in for the night...
now I need a get_company_urls function, from there I need a get_company_data and I'm basically done correct? okay I'm an intern and I'm the last one left in the office, I think it's time to depart. Thanks for the help Arevos. Have a good weekend. |
|
|
|
|
|
#85 | ||
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
Also, some error handling will probably be necessary. Ideally, you don't want your program to end the moment your connection times out once. Fortunately, error handling is easier than it sounds ![]() Quote:
|
||
|
|
|
|
|
#86 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 874
Rep Power: 4
![]() |
Great job Arevos! This is some excellent tutoring.
Excellent work zem52887, you learn quick and are actually reading every reply! I hope you get a job out of this (or at least avoid carpal tunnel). There should be a hall of fame for threads like these. |
|
|
|
|
|
#87 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Is it just me, or does ripping off data from Yahoo Finance not seem like how financial institutions are supposed to operate?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#88 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Absolutely. I was going to call attention to this, as well as the assembler thread involving Narue, as prime examples of the true worth of a forum. Two noobs coupled with two top-notch pros; anyone not following them has missed a true pleasure.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#89 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I've been very impressed myself. It's nice to see people who take in information, are polite, and try stuff themselves before asking questions. It's a reminder of why I'm here.
|
|
|
|
|
|
#90 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
Capitalism being what it is, companies will always seek the easiest option that's not outright illegal, so wanting to gather public-domain financial information from a website doesn't come as a surprise to me. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|