avatar
佛版都是大老爷啊# PhotoGear - 摄影器材
b*1
1
题目是 convert a provided search page and its results into an "API". The
final result will be a Javascript function that takes a search query and
return as JSON. To Create this all of your Javascript code will be injected
into the page before it can be used.
Search page source:
http://toronto.craigslist.ca/search/ggg
function will stimualte the search query
Result source:
http://toronto.craigslist.ca/search/ggg?query=tickets&is_paid=a
Desired Javascript Method results example
Function craigsilistsearch(searchQuery) {...}
Desired API JSON results example
[
{"image": "http://images.craigsist.org/oogog_lgx.jpg", "title":"looking for Runway Models fro Fashion Show", "date":"2016-03-03", "location":"(Downtown Toronto)"]},
{"image": "http://images.craigsist.org/oogog_lgx.jpg", "title":"looking for Runway Models fro Fashion Show", "date":"2016-03-03", "location":"(Downtown Toronto)"]},
...
]
Javascript 不是很熟,请知道的牛人,给点提示。多谢了
avatar
l*n
2
25个 fillment centers, 4M packages/day/center
from ABC
avatar
j*y
4
把 HTML 转成 JSON. 有的像当年写 compiler 的parser 一样。
感觉前端的东西好难的
avatar
t*l
5
赔了多少年攒出来的家底

【在 l******n 的大作中提到】
: 25个 fillment centers, 4M packages/day/center
: from ABC

avatar
h*e
7
我前年面一个做js UI engine的小公司的时候面过类似的题。
avatar
a*k
8
薄利多销
avatar
t*5
10
这种题不光js可以出 python这种也可以出,基本上你要做的就是build一个小型的api
server,你这里还涉及到异步,不过简单一点你可以写成非异步的抓取,你要做的就是:
1. 用js访问给定的query页面
2. 读取html content
3. 用某种工具来抓取html内容(python有beautifulsoup, js的话你可用npm,手写的
话可以用regex)
4. 用抓到的内容construct data object然后 JSON.parse(objectData) 作为函数的返回
具体的一个例子你可以参考这个的代码 https://www.npmjs.com/package/scrape
avatar
i*y
11
30B annual revenue. 100M orders per day. That's 36.5B orders per year.
So average order size is less than a buck? ft

【在 l******n 的大作中提到】
: 25个 fillment centers, 4M packages/day/center
: from ABC

avatar
G*d
12
牛啊 够买两个无敌兔了

【在 r***v 的大作中提到】
: 擦。。。还was 2999.95w
avatar
a*g
14
又不是平均每天都那么多

【在 i**y 的大作中提到】
: 30B annual revenue. 100M orders per day. That's 36.5B orders per year.
: So average order size is less than a buck? ft

avatar
e*t
15

好像是。

【在 G********d 的大作中提到】
: 牛啊 够买两个无敌兔了
avatar
e*t
18

有MIR?

【在 G********d 的大作中提到】
: amazon买jr的可以做mir么
avatar
s*n
19
打印机的300

【在 e****t 的大作中提到】
:
: 有MIR?

avatar
g*n
20
一定是4,5百的打印机

【在 s*n 的大作中提到】
: 打印机的300
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。