[Tutor] beautifulsoup

2016-10-03 Thread Crusier
I am trying to scrap from the (span class= 'Number'). The code looks like this on the pages I am scrapping: 9910.00(-0.1%) Menu Max Quantity 100.000 Average Quantity 822 Previous Order 96 Max Price 104 Number of Trades 383 Min Price 59 Total

[Tutor] Unable to download , using Beautifulsoup

2016-07-29 Thread Crusier
or is there any way to retrieve the data listed. Thank you Regards, Crusier from bs4 import BeautifulSoup import urllib import requests stock_code = ('00939', '0001') def web_scraper(stock_code): broker_url = 'http://data.tsci.com.cn/stock/' end_url = '/STK_Broker.htm' for code

[Tutor] Fwd: 10+ Different Python Script?

2016-07-13 Thread Crusier
Dear All, I am currently using: Python 3.5 Window 7 I have a python script which is used for downloading Real Time Stocks. Currently, there is over a 1000 stocks in the Portfolio. If I download the market info during market hours, it would take over 40 minutes to finish downloading all the

Re: [Tutor] Web Page Scraping

2016-05-24 Thread Crusier
Hi Walter, Thank you for taking your time to do all the explanation. Have a great day. Cheers, Hank On Tue, May 24, 2016 at 10:45 PM, Walter Prins wrote: > On 24 May 2016 at 15:37, Walter Prins wrote: >> print(name1.encode(sys.stdout.encoding,

[Tutor] Web Page Scraping

2016-05-23 Thread Crusier
Dear All, I am trying to scrape a web site using Beautiful Soup. However, BS doesn't show any of the data. I am just wondering if it is Javascript or some other feature which hides all the data. I have the following questions: 1) Please advise how to scrape the following data from the website:

Re: [Tutor] Tutor Digest, Vol 147, Issue 30

2016-05-19 Thread Crusier
> From: Peter Otten <__pete...@web.de> > To: tutor@python.org > Subject: Re: [Tutor] SQLite > Message-ID: <nhk0h1$9et$1...@ger.gmane.org> > Content-Type: text/plain; charset="ISO-8859-1" > > Crusier wrote: > >> Dear Alan, >> >>

[Tutor] SQLite

2016-05-19 Thread Crusier
have been committed or they will be lost. conn.close() The following error has came out sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 5 supplied. Please advise. Thank you very much. Regards, Crusier

Re: [Tutor] Tutor Digest, Vol 147, Issue 10

2016-05-03 Thread Crusier
.ga...@yahoo.co.uk> > To: tutor@python.org > Subject: Re: [Tutor] sqlite > Message-ID: <ngagp1$8a3$1...@ger.gmane.org> > Content-Type: text/plain; charset=utf-8 > > On 03/05/16 10:09, Crusier wrote: > > > I am just wondering if there is any good reference which I ca

[Tutor] sqlite

2016-05-03 Thread Crusier
Dear All, I am just wondering if there is any good reference which I can learn how to program SQLITE using Python I can not find any book is correlated to Sqlite using Python. Thank you Regards, Hank ___ Tutor maillist - Tutor@python.org To

[Tutor] Beautiful Soup

2016-01-18 Thread Crusier
Hi Python Tutors, I am currently able to strip down to the string I want. However, I have problems with the JSON script and I am not sure how to slice it into a dictionary. import urllib import json import requests from bs4 import BeautifulSoup url =

Re: [Tutor] Tutor Digest, Vol 142, Issue 11

2015-12-14 Thread Crusier
error with a simple program (Steven D'Aprano) >2. Re: Calculation error with a simple program (Jim Gallaher) >3. Re: Calculation error with a simple program (Todd Purple) > 4. Re: Tutor Digest, Vol 142, Issue 10 (Ken

[Tutor] Beautiful Soup

2015-12-12 Thread Crusier
Dear All, I am trying to scrap the following website, however, I have encountered some problems. As you can see, I am not really familiar with regex and I hope you can give me some pointers to how to solve this problem. I hope I can download all the transaction data into the database. However, I

[Tutor] Beautifulsoup Queries

2015-12-08 Thread Crusier
Dear All, I am using Python 3.4, I tried to scrap the web and eventually put those data into a database for analysis. While I am using Beautifulsoup to scrap the web, I encountered 2 problems: 1. Using Beautiful Soup, the webmaster on the other end is using the same class, so I got a whole list

[Tutor] Problem on handling if statement

2015-11-25 Thread Crusier
Dear All, I am trying to do some web scraping. Attached below is my code: from bs4 import BeautifulSoup import requests #string = str(0175, 0005, 1177) url = "https://www.etnet.com.hk/www/eng/stocks/realtime/quote.php?code=0175; def web_scraper(url): response = requests.get(url) html

[Tutor] Unable to retreive the stock code

2015-11-15 Thread Crusier
Dear All, I am currently trying to download the stock code. I am using Python 3.4 and the code is as follows: from bs4 import BeautifulSoup import requests import re url = 'https://www.hkex.com.hk/eng/market/sec_tradinfo/stockcode/eisdeqty.htm' def web_scraper(url): response =

[Tutor] Beautiful Soup

2015-10-12 Thread Crusier
Hi I am using Python 3.4. I am trying to do some web scraping at this moment. I got stuck because there is an IndexError: list index out of range if I put stock_code = (18). My desire output is that the script is able to detect print out the recent price whether it is up, down or unchanged.

[Tutor] Beautiful Soup

2015-09-29 Thread Crusier
Hi I have recently finished reading "Starting out with Python" and I really want to do some web scraping. Please kindly advise where I can get more information about BeautifulSoup. It seems that Documentation is too hard for me. Furthermore, I have tried to scrap this site but it seems that

[Tutor] String Problem

2015-07-06 Thread Crusier
Dear All, I have used the urllib.request and download some of the information from a site. I am currently using Python 3.4. My program is as follows: import urllib.request response = urllib.request.urlopen(' http://www.hkex.com.hk/eng/ddp/Contract_Details.asp?PId=175') saveFile =

[Tutor] File Compare

2015-01-08 Thread Crusier
Hi, I am comparing two files, and the program has problem comparing two files. I am currently using Python 3.3 and Window 7. Attached is my code: import difflib old_file = open('0105-up.txt','r') file_contentsA = old_file.read() A = file_contentsA.split(,) print(A) print() new_file =

Re: [Tutor] File Compare

2015-01-08 Thread Crusier
Hi Danny, Thanks for your suggestion. The ideal of output of this program is to show if there is any new number added to the new file. In other words, the file content of file1 [0001.hk, 0002.hk, 0003.hk, 0004.hk] is comparing with the file content of file2 [0001.hk, 0002.hk, 0003.hk,

[Tutor] Compare two text files

2014-10-13 Thread Crusier
Hi Alan, Attached are the two text files (stocklist.txt stocklist1.txt) which I want to do a comparison with the content of the file, Basically, I want to see if there are any new numbers added to the file. Please comment on the sequence of the file: 1. First, Open up the File No. 1 and put the

[Tutor] Web Praser

2011-10-21 Thread Crusier
Hi, I am new to programming. I want to know what I should look at if I want to learn more about Web Praser. I know there is something called Beautiful Soup but I think it is kind of difficult for me at this stage. Thank you Regards, Crusier ___ Tutor

[Tutor] Scrapy vs. Beautiful Soup

2010-10-06 Thread Crusier
Hi Emile, I have also found that there is something called Scrapy. Please kindly comment on it. Which one is easier to use compared with Beautiful Soup? Thanks in advance. Cheers, Hank ___ Tutor maillist - Tutor@python.org To unsubscribe or change

[Tutor] Downloading data from web

2010-10-04 Thread Crusier
I am trying to extract web data and put it into a database for analysis.I am just wondering what is the best way to do it and I will try to dig up information from there. Please help me how can I kick start this project. Cheers, Hank ___ Tutor maillist