forked from tychxn/jd-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
## area参数自助生成 | ||
# 地址id如何获取? | ||
|
||
>该脚本能生成下单所需的area参数 | ||
## 方法一 | ||
|
||
👉运行脚本,根据提示逐级选择区域即可。 | ||
在本文件夹中根据地址查询对应的文件。 | ||
|
||
## 方法二 | ||
|
||
在商品页面(例如 https://item.jd.com/1178879.html) 打开开发者工具,在 Console 中执行以下 Javascript 代码: | ||
|
||
```js | ||
var el = document.getElementsByClassName("ui-area-text")[0] | ||
var area_name = el.getAttribute("title") | ||
var area_id = el.getAttribute("data-id").replace(/-/g, "_") | ||
console.log(area_name) | ||
console.log(area_id) | ||
``` | ||
|
||
## 方法三 | ||
|
||
运行本文件夹中的 Python 脚本,根据提示逐级选择区域。感谢 @6r6 提供脚本~ | ||
|
||
```sh | ||
python select_area_id.py | ||
``` | ||
python get_area_id.py | ||
``` |