EastMoney | python requests Django nodejs koa | Application Framework library
kandi X-RAY | EastMoney Summary
kandi X-RAY | EastMoney Summary
python requests + Django+ nodejs koa+ mysql 实现东方财富、天天基金股票基金证券数据抓取,数据分析,可视化
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of EastMoney
EastMoney Key Features
EastMoney Examples and Code Snippets
Community Discussions
Trending Discussions on EastMoney
QUESTION
I'm trying to loop pages from this link and extract the interesting part.
Please see the contents in the red circle in the image below.
Here's what I've tried:
...ANSWER
Answered 2020-Dec-26 at 20:44BeautifulSoup
won't see this stuff, as it's rendered dynamically by JS
, but there's an API endpoint you can query to get what you're after.
Here's how:
QUESTION
I am trying to download the json data into a df table from: "http://emweb.securities.eastmoney.com/NewFinanceAnalysis/lrbAjax?companyType=4&reportDateType=0&reportType=1&endDate=&code=SZ002475" , which is the raw data of table at bottom of this page "http://emweb.securities.eastmoney.com/NewFinanceAnalysis/Index?type=web&code=SZ002475#"
The json page appears to be simple json data as"[{\"SECURITYCODE\":\"002475.SZ\",\"REPORTTYPE\":\"1\",\"TYPE\":\"4\",\"REPORTDATE\":\"2019/9/30 0:00:00\",\"TOTALOPERATEREVE\":\"37836138416.35\",\"OPERATEREVE\":\"37836138416.35\",........"
However, nothing was returned from the following codes:
...ANSWER
Answered 2020-Feb-13 at 17:56Using the given URL.
QUESTION
I am trying to download the json data into a df table from: "http://emweb.securities.eastmoney.com/NewFinanceAnalysis/lrbAjax?companyType=4&reportDateType=0&reportType=1&endDate=&code=SZ002475" , which is the raw data of table at bottom of this page "http://emweb.securities.eastmoney.com/NewFinanceAnalysis/Index?type=web&code=SZ002475#". The json page appears to be simple json data as"[{\"SECURITYCODE\":\"002475.SZ\",\"REPORTTYPE\":\"1\",\"TYPE\":\"4\",\"REPORTDATE\":\"2019/9/30 0:00:00\",\"TOTALOPERATEREVE\":\"37836138416.35\",\"OPERATEREVE\":\"37836138416.35\",........" However, nothing was returned from the following codes. On the other hand, can python manipulate json in other ways?
...ANSWER
Answered 2020-Feb-13 at 13:37The json downloaded from the url was downloaded in the wrong format, for example "人民币]"
was converted to "\xe4\xba\xba\xe6\xb0\x91\xe5\xb8\x81\\"
, and the JsonReader
in pandas
couldn't handle that. You can download the raw data with requests and convert it to json instead
QUESTION
I am trying to download the json data from: link.
The json data are divided into categories like:"pjtj:", "jgyc:", "mgsy:"...etc.
My codes returned :
ValueError: arrays must all be same length
How to only extract the data under the "mgsy:" category?
My code:
...ANSWER
Answered 2020-Feb-12 at 11:08You can try to use a intermediate step with json, here's an example:
QUESTION
The target page url is "http://data.eastmoney.com/gzfx/list.html" There is a table of stock list at the bottom of this page, and it has 70+ pages, you can move to other pages by click next ("下一页"), but the link of the page never change, it is always show "http://data.eastmoney.com/gzfx/list.html"
I used selenium to click the next page and use "html_code=browser.page_source" to get the content of the html, but I never get the content of the new page, it always show the first page.
I have tried to use "browser.refresh()" to get the page refreshed, but it will go back to the first page, the second page share the same link with first page.
My question is how to get the updated page content after I click the next button.
below is my code:
...ANSWER
Answered 2019-Oct-05 at 15:20The source of the page doesn't change on Javascript triggered update of the content.
Instead of getting page source, try to get the content of the body element. something like that (code not tested)
QUESTION
Rule(LinkExtractor(allow=rule.get("allow", None), restrict_xpaths=rule.get("restrict_xpaths", ""),deny=('guba','f10','data','fund.*?\.eastmoney\.com/\d+\.html','quote','.*so\.eastmoney.*','life','/gonggao/')),callback=rule.get("callback", ""),follow=rule.get('follow',True))
Rule setting ↑
runing logs:
...ANSWER
Answered 2019-Jun-27 at 03:34From documentation:
deny (a regular expression (or list of)) – a single regular expression (or list of regular expressions) that the (absolute) urls must match in order to be excluded (ie. not extracted). It has precedence over the allow parameter. If not given (or empty) it won’t exclude any links.
https://doc.scrapy.org/en/latest/topics/link-extractors.html#module-scrapy.linkextractors.lxmlhtml
This means that deny
is a list of regular expressions that should match url. The patterns defined in your code do not match the urls you are crawling - you need to add wildcards at the beginning and the end if you want contains sort of matching:
QUESTION
I'm a R newbie and here I have an issue of using R to get a fund's daily net value from one website's API.
The error is "XML content does not seem to be XML" when running htmlTreeParse. I searched this question but those answers (such as using http instead of https) don't fit my problem.
I appreciate you your help if you know how to fix it. Since it contains some Chinese characters you may not see them display correctly.
...ANSWER
Answered 2018-Jul-09 at 09:37This is a problem with the R encoding and the XML library.
This works:
QUESTION
Sorry for this silly question as I'm new to web scraping and have no knowledge about HTML etc.
I'm trying to scrape data from this website. Specifically, from this part/table of the page:
末"四"位数 9775,2275,4775,7275 末"五"位数 03881,23881,43881,63881,83881,16913,66913 末"六"位数 313110,563110,813110,063110 末"七"位数 4210962,9210962,9785582 末"八"位数 63262036 末"九"位数 080876872
I'm sorry that's in Chinese and it looks terrible since I can't embed the picture. However, The table is roughly in the middle(40 percentile from the top) of the page. The table id is 'tr_zqh'
.
Here is my source code:
...ANSWER
Answered 2018-Mar-24 at 19:26If you extract a couple of variables from the initial page you can use themto make a request to the api directly. Then you get a json object which you can use to get the data.
QUESTION
When i use scrapy to get some stocks information from 'http://quote.eastmoney.com/stocklist.html',I can't get right response. Actually, I get nothing when I run it. Here is the contents of stocks.py:
...ANSWER
Answered 2017-Jun-06 at 05:20Here, I did a short code review:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install EastMoney
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page