F# - How To Use CSS-Selector On TitleHow to horizontally center a <div>?Set cellpadding and cellspacing in CSS?Which characters are valid in CSS class names/selectors?How to check whether a checkbox is checked in jQuery?Is there a CSS parent selector?Is there a “previous sibling” selector?Change an HTML5 input's placeholder color with CSSCSS selector for first element with classHow do I vertically center text with CSS?Is it possible to apply CSS to half of a character?

How to identify whether a publisher is genuine or not?

Garage door sticks on a bolt

What is the use of command?

What action is recommended if your accommodation refuses to let you leave without paying additional fees?

Avoiding dust scattering when you drill

SOQL injection vulnerability issue

Can I bring this power bank on board the aircraft?

Is the "spacetime" the same thing as the mathematical 4th dimension?

Can an untrusted VPN client monitor my network activity?

Smallest PRIME containing the first 11 primes as sub-strings

Does the US Armed Forces refuse to recruit anyone with an IQ less than 83?

Principled construction of the quaternions

Job interview by video at home and privacy concerns

Why the first octet of a MAC address always end with a binary 0?

How to level a picture frame hung on a single nail?

Why aren't faces sharp in my f/1.8 portraits even though I'm carefully using center-point autofocus?

What is the meaning of first flight and introduction in aircraft production?

Why has Speaker Pelosi been so hesitant to impeach President Trump?

Prove that the 23 people have the same weight.

Everyone Gets a Window Seat

French license plates

Missing quartile in boxplot

How to find places to store/land a private airplane?

Paint 10 cells of a 10x10 grid



F# - How To Use CSS-Selector On Title


How to horizontally center a <div>?Set cellpadding and cellspacing in CSS?Which characters are valid in CSS class names/selectors?How to check whether a checkbox is checked in jQuery?Is there a CSS parent selector?Is there a “previous sibling” selector?Change an HTML5 input's placeholder color with CSSCSS selector for first element with classHow do I vertically center text with CSS?Is it possible to apply CSS to half of a character?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0















Using CssSelect, I would like to retrieve a number of span title tags from each table row and write them to a csv file.



<!DOCTYPE html>
<html>
<head>
<title>F# CSS-Selector</title>
</head>
<body>
<table id="tblId01" class="tblClss01">
<tbody>
<tr>
<td class="tdClss01">
<span class="spnClss01">
<span title="A &amp; B">w x</span>
<span title="CD"><a href="/alpha" target="_blank">Alpha</a></span> + <span title="D"><a
href="/bravo" target="_blank">Bravo</a></span>
<span title="E"><a href="/charlie" target="_blank">Charlie</a></span>
</span>
</td>
</tr>
<tr>
<td class="tdClss01">
<span class="spnClss01">
<span title="A &amp; B">y z</span>
<span title="CD"><a href="/delta" target="_blank">Delta</a></span> + <span title="D"><a
href="/echo" target="_blank">Echo</a></span>
<span title="E"><a href="/foxtrot" target="_blank">Foxtrot</a></span>
</span>
</td>
</tr>
</tbody>
</table>
</body>
</html>


My current effort is as follows but, unfortunately, the code is iterating through the titles in the each row but not generating the expected output as indicated below.



module SOQN = 

open System
open System.IO
open FSharp.Data

let url = @"C:tmpSOQN_CSS-Selector-Title_FS.html"
let rslt = FSharp.Data.HtmlDocument.Load(url)

let rcrd =
rslt.CssSelect(".tdClss01 > .spnClss01 > span[title]")
|> List.map (fun a -> a.InnerText().Trim())

let lists = [rcrd]

let rec transpose xs =
match xs with
[]::_ -> []
| xs -> List.map List.head xs :: transpose (List.map List.tail xs)

let output = transpose lists
|> Array.ofList
|> Array.map (fun x -> String.concat ";" x)

printfn "%A" output

let main() =
printfn ""
printfn "SOQN: How To Use CSS-Selector On Title?"
printfn ""
do
printfn "Saving to csv file..."
use writer = new StreamWriter(@"C:tmpCSS-Selector-Title.csv")
writer.WriteLine "A;B;C;D;E"
output
|> Seq.iter writer.WriteLine
printfn ""
printfn "Fini!"
printfn ""
0

[<EntryPoint>]
main() |> ignore

// Actual Output:
// A;B;C;D;E
// w x
// Alpha
// Bravo
// Charlie
// y z
// Delta
// Echo
// Foxtrot

// Expected Output:
// A;B;C;D;E
// w;x;Alpha;Bravo;Charlie
// y;z;Delta;Echo;Foxtrot
//


What am I missing?










share|improve this question
































    0















    Using CssSelect, I would like to retrieve a number of span title tags from each table row and write them to a csv file.



    <!DOCTYPE html>
    <html>
    <head>
    <title>F# CSS-Selector</title>
    </head>
    <body>
    <table id="tblId01" class="tblClss01">
    <tbody>
    <tr>
    <td class="tdClss01">
    <span class="spnClss01">
    <span title="A &amp; B">w x</span>
    <span title="CD"><a href="/alpha" target="_blank">Alpha</a></span> + <span title="D"><a
    href="/bravo" target="_blank">Bravo</a></span>
    <span title="E"><a href="/charlie" target="_blank">Charlie</a></span>
    </span>
    </td>
    </tr>
    <tr>
    <td class="tdClss01">
    <span class="spnClss01">
    <span title="A &amp; B">y z</span>
    <span title="CD"><a href="/delta" target="_blank">Delta</a></span> + <span title="D"><a
    href="/echo" target="_blank">Echo</a></span>
    <span title="E"><a href="/foxtrot" target="_blank">Foxtrot</a></span>
    </span>
    </td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>


    My current effort is as follows but, unfortunately, the code is iterating through the titles in the each row but not generating the expected output as indicated below.



    module SOQN = 

    open System
    open System.IO
    open FSharp.Data

    let url = @"C:tmpSOQN_CSS-Selector-Title_FS.html"
    let rslt = FSharp.Data.HtmlDocument.Load(url)

    let rcrd =
    rslt.CssSelect(".tdClss01 > .spnClss01 > span[title]")
    |> List.map (fun a -> a.InnerText().Trim())

    let lists = [rcrd]

    let rec transpose xs =
    match xs with
    []::_ -> []
    | xs -> List.map List.head xs :: transpose (List.map List.tail xs)

    let output = transpose lists
    |> Array.ofList
    |> Array.map (fun x -> String.concat ";" x)

    printfn "%A" output

    let main() =
    printfn ""
    printfn "SOQN: How To Use CSS-Selector On Title?"
    printfn ""
    do
    printfn "Saving to csv file..."
    use writer = new StreamWriter(@"C:tmpCSS-Selector-Title.csv")
    writer.WriteLine "A;B;C;D;E"
    output
    |> Seq.iter writer.WriteLine
    printfn ""
    printfn "Fini!"
    printfn ""
    0

    [<EntryPoint>]
    main() |> ignore

    // Actual Output:
    // A;B;C;D;E
    // w x
    // Alpha
    // Bravo
    // Charlie
    // y z
    // Delta
    // Echo
    // Foxtrot

    // Expected Output:
    // A;B;C;D;E
    // w;x;Alpha;Bravo;Charlie
    // y;z;Delta;Echo;Foxtrot
    //


    What am I missing?










    share|improve this question




























      0












      0








      0








      Using CssSelect, I would like to retrieve a number of span title tags from each table row and write them to a csv file.



      <!DOCTYPE html>
      <html>
      <head>
      <title>F# CSS-Selector</title>
      </head>
      <body>
      <table id="tblId01" class="tblClss01">
      <tbody>
      <tr>
      <td class="tdClss01">
      <span class="spnClss01">
      <span title="A &amp; B">w x</span>
      <span title="CD"><a href="/alpha" target="_blank">Alpha</a></span> + <span title="D"><a
      href="/bravo" target="_blank">Bravo</a></span>
      <span title="E"><a href="/charlie" target="_blank">Charlie</a></span>
      </span>
      </td>
      </tr>
      <tr>
      <td class="tdClss01">
      <span class="spnClss01">
      <span title="A &amp; B">y z</span>
      <span title="CD"><a href="/delta" target="_blank">Delta</a></span> + <span title="D"><a
      href="/echo" target="_blank">Echo</a></span>
      <span title="E"><a href="/foxtrot" target="_blank">Foxtrot</a></span>
      </span>
      </td>
      </tr>
      </tbody>
      </table>
      </body>
      </html>


      My current effort is as follows but, unfortunately, the code is iterating through the titles in the each row but not generating the expected output as indicated below.



      module SOQN = 

      open System
      open System.IO
      open FSharp.Data

      let url = @"C:tmpSOQN_CSS-Selector-Title_FS.html"
      let rslt = FSharp.Data.HtmlDocument.Load(url)

      let rcrd =
      rslt.CssSelect(".tdClss01 > .spnClss01 > span[title]")
      |> List.map (fun a -> a.InnerText().Trim())

      let lists = [rcrd]

      let rec transpose xs =
      match xs with
      []::_ -> []
      | xs -> List.map List.head xs :: transpose (List.map List.tail xs)

      let output = transpose lists
      |> Array.ofList
      |> Array.map (fun x -> String.concat ";" x)

      printfn "%A" output

      let main() =
      printfn ""
      printfn "SOQN: How To Use CSS-Selector On Title?"
      printfn ""
      do
      printfn "Saving to csv file..."
      use writer = new StreamWriter(@"C:tmpCSS-Selector-Title.csv")
      writer.WriteLine "A;B;C;D;E"
      output
      |> Seq.iter writer.WriteLine
      printfn ""
      printfn "Fini!"
      printfn ""
      0

      [<EntryPoint>]
      main() |> ignore

      // Actual Output:
      // A;B;C;D;E
      // w x
      // Alpha
      // Bravo
      // Charlie
      // y z
      // Delta
      // Echo
      // Foxtrot

      // Expected Output:
      // A;B;C;D;E
      // w;x;Alpha;Bravo;Charlie
      // y;z;Delta;Echo;Foxtrot
      //


      What am I missing?










      share|improve this question
















      Using CssSelect, I would like to retrieve a number of span title tags from each table row and write them to a csv file.



      <!DOCTYPE html>
      <html>
      <head>
      <title>F# CSS-Selector</title>
      </head>
      <body>
      <table id="tblId01" class="tblClss01">
      <tbody>
      <tr>
      <td class="tdClss01">
      <span class="spnClss01">
      <span title="A &amp; B">w x</span>
      <span title="CD"><a href="/alpha" target="_blank">Alpha</a></span> + <span title="D"><a
      href="/bravo" target="_blank">Bravo</a></span>
      <span title="E"><a href="/charlie" target="_blank">Charlie</a></span>
      </span>
      </td>
      </tr>
      <tr>
      <td class="tdClss01">
      <span class="spnClss01">
      <span title="A &amp; B">y z</span>
      <span title="CD"><a href="/delta" target="_blank">Delta</a></span> + <span title="D"><a
      href="/echo" target="_blank">Echo</a></span>
      <span title="E"><a href="/foxtrot" target="_blank">Foxtrot</a></span>
      </span>
      </td>
      </tr>
      </tbody>
      </table>
      </body>
      </html>


      My current effort is as follows but, unfortunately, the code is iterating through the titles in the each row but not generating the expected output as indicated below.



      module SOQN = 

      open System
      open System.IO
      open FSharp.Data

      let url = @"C:tmpSOQN_CSS-Selector-Title_FS.html"
      let rslt = FSharp.Data.HtmlDocument.Load(url)

      let rcrd =
      rslt.CssSelect(".tdClss01 > .spnClss01 > span[title]")
      |> List.map (fun a -> a.InnerText().Trim())

      let lists = [rcrd]

      let rec transpose xs =
      match xs with
      []::_ -> []
      | xs -> List.map List.head xs :: transpose (List.map List.tail xs)

      let output = transpose lists
      |> Array.ofList
      |> Array.map (fun x -> String.concat ";" x)

      printfn "%A" output

      let main() =
      printfn ""
      printfn "SOQN: How To Use CSS-Selector On Title?"
      printfn ""
      do
      printfn "Saving to csv file..."
      use writer = new StreamWriter(@"C:tmpCSS-Selector-Title.csv")
      writer.WriteLine "A;B;C;D;E"
      output
      |> Seq.iter writer.WriteLine
      printfn ""
      printfn "Fini!"
      printfn ""
      0

      [<EntryPoint>]
      main() |> ignore

      // Actual Output:
      // A;B;C;D;E
      // w x
      // Alpha
      // Bravo
      // Charlie
      // y z
      // Delta
      // Echo
      // Foxtrot

      // Expected Output:
      // A;B;C;D;E
      // w;x;Alpha;Bravo;Charlie
      // y;z;Delta;Echo;Foxtrot
      //


      What am I missing?







      html css-selectors f#-data






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 20:21







      matekus

















      asked Mar 28 at 9:19









      matekusmatekus

      4122 silver badges11 bronze badges




      4122 silver badges11 bronze badges

























          0






          active

          oldest

          votes













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55393976%2ff-how-to-use-css-selector-on-title%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55393976%2ff-how-to-use-css-selector-on-title%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해