人力検索はてな
モバイル版を表示しています。PC版はこちら
i-mobile

UWSCの質問です。

下記のソースから価格値「102.812」のデーターをとりたいのですが、コードを教えてください。
//<span class="dsn_now_rate now">102.812</span>

また、添付画像に示すボタンを押すときのコードを教えてください。
?1分
<label class="checked" id="label1" onclick="if ($('.tradeView').is(':visible')) { lineInit($('#assetSelect').val()); }" for="Radio1">1分取引</label>

?2分
<label class="checked" id="label2" onclick="if ($('.tradeView').is(':visible')) { lineInit($('#assetSelect').val()); }" for="Radio2">2分取引</label>

?High
<a class="exo_button-high" onclick="bet = 1; $('#bet').text('HIGH'); $('#bet').removeClass('bet_select_low').addClass('bet_select_high'); $(this).addClass('bet_select'); $('.dsn_low_button a').removeClass('bet_select');" href="javascript:void(0);"><span><p class="high_text">倍率<span class="odds">1.75</span></p><span class="high_text_end" style="display: none;">受付終了</span></span></a>

*サイトのURLです。
http://ex-option.com/jp/pc/demos/trade

長くなりますので質問を2つに分けます。
よろしくお願いいたします。


1406793675
●拡大する

●質問者: iwana1999
●カテゴリ:ウェブ制作
○ 状態 :終了
└ 回答数 : 1/1件

▽最新の回答へ

1 ● lang_and_engine
●1000ポイント

どうぞ




// 画面上からいろいろな情報をアレするコード


// IEを自動制御するUWSCコードの参考
// http://d.hatena.ne.jp/language_and_engineering/20140204/controlIeBrowserbyUWSC


// アクセスしたいページのURL
url = "http://ex-option.com/jp/pc/demos/trade"

// 新規IEオブジェクトを作成
ie = createOLEobj("InternetExplorer.Application")

// 起動中のIEを見えるように
ie.visible = True
wid = hndtoid( ie.hwnd )
acw( wid )


// 対象ページを開く
ie.navigate( url )
ie_wait( ie )

sleep(3)


// 現在のレート
span_rate = tag_and_class_from( ie.Document, "span", "dsn_now_rate now" )

msgbox( "現在のレートは" + span_rate.innerHTML )


// minボタン

sleep(2)
label1 = gid( ie, "label1" )
label1.click()
msgbox("min1をクリックしました。")

sleep(2)
label2 = gid( ie, "label2" )
label2.click()
msgbox("min2をクリックしました。")


// High/Low

td_high = tag_and_class_from( ie.Document, "td", "dsn_high_button" )
as_high = tag_name_from( td_high, "a" )
a_high = as_high.Item(0)
a_high.onclick()
msgbox("HIGHをクリックしました。")


td_low = tag_and_class_from( ie.Document, "td", "dsn_low_button" )
as_low = tag_name_from( td_low, "a" )
a_low = as_low.Item(0)
a_low.onclick()
msgbox("LOWをクリックしました。")


// 金額ボタンは押さずに数値を直接入力する
price_box = gid( ie, "money" )

price_box.value = "1000"
sleep(3)


price_box.value = "5000"
sleep(3)


// 購入

buy_button = gid( ie, "buy_button" )
buy_button.onclick()



msgbox("完了")



// 以下は関数



// IEがビジー状態の間待ちます
procedure ie_wait( ie )
 repeat
 sleep( 0.1 )
 until ( ! ie.busy ) and ( ie.readystate = 4 )
 
 sleep( 0.2 )
fend


// getElementById
function gid( ie, dom_id )
 result = ie.document.getElementById( dom_id )
fend


// getElementsByTagName( parent, tag_name )
function tag_name( ie, tag_name )
 result = tag_name_from( ie.Document, tag_name )
fend

function tag_name_from( parent, tag_name )
 result = parent.getElementsByTagName( tag_name )
fend


// タグ名とクラス名を指定して最初の1つだけ要素を返す
function tag_and_class_from( parent, tag_name, class_name )
 tags = tag_name_from( parent, tag_name )
 
 for i = 0 to tags.length - 1
 ifb tags.Item( i ).getAttribute("class") = class_name then
 result = tags.Item( i )
 endif
 next

fend

関連質問

●質問をもっと探す●



0.人力検索はてなトップ
8.このページを友達に紹介
9.このページの先頭へ
対応機種一覧
お問い合わせ
ヘルプ/お知らせ
ログイン
無料ユーザー登録
はてなトップ