我想用F#和Canopy編寫一個簡單的抓取工具(請參閱http://lefthandedgoat.github.io/canopy/)。我試圖從類「.application-tile」中的所有元素中提取文本。但是,在下面的代碼中,我得到了以下的構建錯誤,我不明白它。用F#和Canopy進行站點抓取
This expression was expected to have type
OpenQA.Selenium.IWebElement -> 'a
but here has type
OpenQA.Selenium.IWebElement
任何想法爲什麼會發生這種情況?謝謝!
open canopy
open runner
open System
[<EntryPoint>]
let main argv =
start firefox
"taking canopy for a spin" &&& fun _ ->
url "https://abc.com/"
// Login Page
"#i0116" << "[email protected]"
"#i0118" << "abc"
click "#abcButton"
// Get the Application Tiles -- BUILD ERROR HAPPENS HERE
elements ".application-tile" |> List.map (fun tile -> (tile |> (element ".application-name breakWordWrap"))) |> ignore
run()
您試圖完成你的List.map? –
我試圖從每個元素中獲取文本/內容。 – Martin