使用C#,我试图从这里找回“P250 | Metallic DDPAT(Factory New)”(当我查看inspect元素时在网页内):
var g_rgAppContextData = {"730":{"appid":730,"name":"Counter-Strike: Global Offensive","icon":"http:\/\/cdn.akamai.steamstatic.com\/steamcommunity\/public\/images\/apps\/730\/69f7ebe2735c366c65c0b33dae00e12dc40edbe4.jpg","link":"http:\/\/steamcommunity.com\/app\/730"}};
fnInitItemDisplay = function() {
UserYou.LoadContexts( g_rgAppContextData );
BuildHover( 'economy_item_55a8de8719556', {"id":"2871922729","owner":"76561198082527859","classid":"310777393","instanceid":"0","icon_url":"-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpopujwezhh3szdYz9D4uO6nYeDg7mmNe3UkD8GsMEo3erDp9St31K3_0JsZTqlLI-SdA5oZwuDqQW2lLrpm9bi6_KhRAkC","icon_url_large":"-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpopujwezhh3szdYz9D4uO6nYeDg8j4MqnWkyUD7pN0jL2WrYis31e2-UtkZD-gIIeVdFVoaVHX_Fnox7281sK06cnP1zI97bNcM7TE","icon_drag_url":"","name":"P250 | Metallic DDPAT","market_hash_name":"P250 | Metallic DDPAT (Factory New)","market_name":"P250 | Metallic DDPAT (Factory New)","name_color":"D2D2D2","background_color":"","type":"Industrial Grade Pistol","tradable":1,"marketable":1,"commodity":0,"market_tradable_restriction":"7","descriptions":[{"type":"html","value":"Exterior: Factory New"},{"type":"html","value":" "},{"type":"html","value":"A low-recoil firearm with a high rate of fire, the P250 is a relatively inexpensive choice against armored opponents. It has been painted using an urban Digital Disruptive Pattern (DDPAT) hydrographic over a metallic base coat."},{"type":"html","value":" "},{"type":"html","value":"The Train Collection","color":"9da1a9","app_data":{"def_index":"65535","is_itemset_name":1}},{"type":"html","value":" "}],"tags":[{"internal_name":"CSGO_Type_Pistol","name":"Pistol","category":"Type","category_name":"Type"},{"internal_name":"weapon_p250","name":"P250","category":"Weapon","category_name":"Weapon"},{"internal_name":"set_train","name":"The Train Collection","category":"ItemSet","category_name":"Collection"},{"internal_name":"normal","name":"Normal","category":"Quality","category_name":"Category"},{"internal_name":"Rarity_Uncommon_Weapon","name":"Industrial Grade","category":"Rarity","color":"5e98d9","category_name":"Quality"},{"internal_name":"WearCategory0","name":"Factory New","category":"Exterior","category_name":"Exterior"}],"pos":1,"appid":"730","contextid":"2"} );
$('economy_item_55a8de8719556').show();
}
fnInitItemDisplay();
我不确定如何做到这一点。我已将GetElementByID
绑定无效。
有什么想法吗?
答案 0 :(得分:0)
如果可以的话,你应该使用webclient:
using (var w = new WebClient()) {
var src = w.DownloadString("url");
var yourvalue = new Regex("market_hash_name\":\"(.*?)\",").Match(src).Groups[1].Value;
}