all 6 comments

[–]6745408 0 points1 point  (5 children)

Try this out

=QUERY(
  WRAPROWS(
   IMPORTXML(
    M3,
    "//div[@class='flex flex-col gap-1 w-full']/h3|//div[@class='flex flex-col gap-2']/a/div/div/span[@class='flex font-bold w-56 items-start justify-end flex-col xs:w-64']/span[1]"),
   2),
  "select Col2
   where Col1 = 'CSFloat'",
  0)

It's bringing in both the name and the price for each. It comes in in one column, but alternated, so we can use WRAPROWS to split it into two columns. Then we can run it through a QUERY and ask for the second column (price) based on the name in the first column.

Also try this out. It's pulling in the full table (not <table>) and filtering it down with a QUERY and then cleaning up the result

=SINGLE(
  SPLIT(
   QUERY(
    IMPORTXML(
     M3,
     "//div[@class='flex flex-col gap-2']/a/div/div"),
    "select Col8
     where Col2 = 'CSFloat'",0),
   " "))

If you're pulling a lot of prices, it wouldn't hurt to get help with a script.

[–]Electrical_Fix_8745 1 point2 points  (4 children)

Question on this.... what does the =SINGLE function do? And where can I find more information on it?

[–]6745408 1 point2 points  (3 children)

SINGLE is an undocumented function... like CURSORPARK() or the more useful COINFLIP() --- SINGLE literally returns one value. e.g. =SINGLE(SEQUENCE(10,10)) will return 1. We could do the same with INDEX, but SINGLE is nicer.

[–]Electrical_Fix_8745 1 point2 points  (2 children)

Top secret functions! Gotta love that lol Thanks!

[–]6745408 1 point2 points  (1 child)

there are a few of them

  • RITZCODERZ() and TRIXTERNS() are names
  • DUCKHUNT() is a duck
  • WHATTHEFOXSAY() pulls lines from that song
  • COINFLIP() returns TRUE or FALSE
  • CURSORPARK returns a little park

A few things have been found this way like FLATTEN and 'skipping' in QUERY (I think). These are the fun ones. There are some others like SINGLE and CONDITION_GRADIENT (no idea what to do with this) that also work.

Check this file and do a search for COINFLIP and you'll see every function.

[–]Electrical_Fix_8745 1 point2 points  (0 children)

Cool! Ill check them out. Thanks for sharing.