As a game designer and writer, I use fantasynamegenerators.com a lot. I'd like to find a way to import results from these name generators into Google Sheets. I've had some success with other sites, but I'm having no luck here.
This is as far as I've gotten:
Use developer tools to inspect <https://www.fantasynamegenerators.com/username-generator.php>
Copy XPath for desired content //*[#id='result']
Enter formula in Google Sheets IMPORTXML(https://www.fantasynamegenerators.com/username-generator.php,"//*[#id='result']/text()")
I got an "Imported content is empty" error, so I tried a couple XPath variations, including //*[#id='result']/text()
None of that did the trick, still getting the same error.
Based on this post, I'm guessing that I'm encountering the same issue ("the content is loaded using jQuery") but I can't confirm this because I know nothing about jQuery. I also have no idea how to track down the URL for the jQuery content, as suggested.
Any help is appreciated! If I can find a solution it'll open up a lot of options for my workflow.
paste this formula anywhere you wish:
=ARRAYFORMULA(QUERY({RANDBETWEEN(ROW(A1:A1661), 999^99),
{"Pixelephant";"Ninjavu";"Pignorant";"Plazy";"Pandaily";"Tweetail";"Coillness";"Evillan";"Lazyhazy";"Sniperil";"Accentaur";"Aggrobot";"Alfairy";"Alpaking";"Alphairy";"Alphantom";"Amighost";"Amigod";"Amigoliath";"Annaconda";"Antelopez";"Antiger";"Apeshifter";"Apexecutioner";"Aquasp";"ArchLizard";"Armydillo";"Aromaster";"Asprince";"Asprincess";"Autoad";"Babeast";"Baboom";"Babuccaneer";"Bachelord";"Baconjurer";"Baconqueror";"Badept";"Badgericho";"Bambinosaur";"Bambooccaneer";"Bamboozle";"Banditch";"Banditto";"Bandroid";"Bansheep";"Barnaclue";"Baroqueen";"Barracupid";"Barrycuda";"Basalamander";"Bassassin";"Basshopper";"BearCrawl";"BearGills";"Bearry";"BeastLee";"Beastern";"Beauty-Rex";"Beezenees";"Behemote";"Binghost";"Bingoblin";"Bingod";"Bingoddess";"Bingoliath";"Blazebra";"Bluffalo";"Boaris";"Bombeast";"Bonghost";"Bongoliath";"Bonsiren";"Boohooligan";"Brassassin";"Brasshopper";"Broncoco";"Brutea";"Brutee-Rex";"BuffaLou";"Buffaloris";"Bullfrogert";"BumbleBeast";"BumbleBeetle";"BumblingBee";"BunBunny";"Butcherry";"Butterflight";"Butterflux";"C-Horse";"C-Lion";"Calamarauder";"Camella";"Camperor";"Candroid";"Capeshifter";"Caribooboo";"Cariboohoo";"Caterpixie";"Caterpolaris";"Catnip";"Celestiger";"Centaura";"Centaurora";"Champeon";"Cheatah";"Chieftaint";"Chimpanther";"Chimpantzer";"Chimpanzer";"Chimpanzy";"Chinchillax";"Chinchilling";"Chipmunkey";"Chosenpai";"Cicadaemon";"Cinnamonster";"Civillain";"Classhopper";"Cloverlord";"Cloverseer";"Coalossus";"Cobrag";"Cobrass";"Cobrawl";"Cocowboy";"Cocowgirl";"Colossubs";"Commandrogenic";"Commandroid";"Conjursa";"Conquerogue";"Conquerry";"Consoldier";"Consoul";"Controll";"Corsairier";"Corsairway";"Cougarfield";"Cougarry";"Cowhale";"Coyotea";"Coyoteerex";"Creaturret";"Crickettle";"Criminail";"Critturtle";"Croccultist";"Crocodino";"Crocodoom";"Crocodoris";"Cubeast";"Cyaninja";"Cybora";"Cybork";"Cyborne";"Cycloth";"Daemonk";"Daemonkey";"Daemonster";"Decorsair";"Delhiminate";"Demonkey";"Demonster";"Devile";"Devillain";"Dimwitch";"Dingoal";"Dingopher";"Dinomite";"Dinosause";"Dinoscythe";"Dinosoaring";"Dismage";"Dismaiden";"Dismister";"Diwrecktor";"Dolphine";"Dolphinkle";"Domignome";"DonKiwi";"Donkeychain";"Draccoon";"Dragonflight";"Dragonightmare";"Drummingbird";"Duelf";"Duskunk";"Dwarvo";"Dwarvos";"Eggcecutioner";"Elephantom";"Eliminature";"Eliminatured";"Emoo";"Emperoar";"Emprescue";"Emufasa";"Emufassa";"Emutant";"Enchantra";"Essaint";"Eurobot";"ExTermite";"Executie";"Eyewearwolf";"Falconartist";"Falcondor";"Falconjure";"Falconjurer";"Fearkat";"Fellama";"Festivalkyrie";"Fiendure";"Flaminghost";"Flamingoal";"Flamingoat";"Flamingopher";"Flexecutioner";"Fowlee";"Frenchanter";"Froghurt";"Frostrich";"Fuguru";"Gamercenary";"Gamermaid";"Gamerman";"Gangstereo";"Gangsteroids";"Geckoco";"Geishadow";"Gerbilbo";"Ghostrich";"GiantPandaisy";"GiantPandame";"GiantPandamonium";"Giantics";"Gibbonbon";"Gigangster";"Giraffiki";"Giraffle";"Gladiablo";"Glamorc";"Glasshopper";"Globster";"Gnunou";"Goath";"Gobling";"Goghost";"Goliatlas";"Gooze";"Gopherrel";"Gorillala";"Gorillamp";"Gorillax";"Gorrilag";"Gorrilava";"Grammarauder";"Grampaladin";"Grapeshifter";"Grasshiphopper";"Griffinish";"Griffinished";"Griffinite";"Griffinkle";"Griminal";"Grincubus";"Gringoblin";"Gringoliath";"GuacaMole";"GuineaPiggy";"GuineaPiglet";"Guruse";"Hamsteroids";"Harlequill";"Havoccultist";"Hawkeye";"Hawkward";"Hedgehawk";"Hedgehoax";"Hedgehog";"Hedgehogger";"Herobot";"Herogue";"Herose";"Herover";"Herringmaster";"Hexecutioner";"Hijackal";"Hippolice";"Hippony";"Hippopotamouse";"Hitmanatee";"Hitmantis";"Hobogre";"HoneyBeetle";"HoneyBeezenees";"Hornettle";"Hoverlord";"Hydroid";"Hydrone";"Hyenada";"Hyenanana";"Hypnotastic";"Hypnotwist";"Hypogre";"Ibiscuit";"Ibiscus";"Iconjurer";"Impaladin";"Incubugs";"Incubuzz";"Indighost";"Indigoliath";"Infergnome";"Jackalf";"Jaguardo";"Jaguwar";"Jalapegnome";"Javampire";"Jellyfists";"Jollygator";"Judgenie";"Judgerm";"Kangaroar";"Kangaroodle";"Kangarookie";"Kappaladin";"Karmagician";"Kegnome";"Kimognome";"Knightclub";"Knighthawk";"Knightingale";"Knightlife";"Knightmare";"Knightshade";"Knighttime";"Koalala";"Koalarry";"Koalassy";"Koalava";"KomodoreDragon";"Komodough";"Komodozer";"Lamagician";"Lamaster";"Laserpent";"Lassassin";"Latignome";"Lavampire";"Lemonster";"Lemurmur";"Leopardon";"Leoparty";"Leprecocoa";"Leprecorn";"Leviatank";"Liquidathor";"Liquidatorus";"Llamaths";"Lobsteroid";"Lobsteroids";"Lockroach";"Locustard";"Loghost";"Macaward";"Madept";"Magmaster";"Magpiechart";"MammothMoth";"Manateerex";"Manghost";"Mantissue";"Marauderby";"Masteroid";"MatriarchAngel";"MatriarchMage";"Mavericksha";"Maybeast";"Meerkatnip";"Megangster";"Metrobot";"Minerd";"Misteroid";"Mobsteroid";"Mobsteroids";"Mockroach";"Monkeyno";"Monkiwi";"Mosquiche";"Mosquitar";"Mosquite";"Mosquitoxic";"Muskunk";"Mutantra";"Napaladin";"Ninja";"Ninjafar";"Ninjava";"Nitrobot";"Nitrogue";"Nitrover";"Nitwitch";"Numbat";"Ocelotus";"Octopirate";"Octopixy";"Octopuds";"Octopuppy";"Ogremlin";"Omegangster";"Omenforcer";"Orangutangle";"Orangutango";"Orangutank";"Orangutitan";"Origamister";"Ostricheyrich";"Ostritches";"Otterminate";"Otterror";"Ownerd";"OysterSauce";"Oysterminate";"Oystrich";"Paladino";"Pandaisy";"Pandame";"Pandamonium";"Pandata";"Panthermal";"Panthermic";"Paparazzombie";"Parascythe";"Parasike";"Parasyclops";"Parrotting";"PatriachAngel";"PatriarchMage";"Patrio";"Patriode";"Patroll";"Peafowlet";"Pedroid";"Pelgriminal";"Pelgrimp";"Pelicancan";"Pelicandy";"Pelicanine";"Pelicannon";"Penguinee";"Phantomahawk";"Phantomato";"Phantomb";"Phantomboy";"Phantomcat";"Phantomfool";"Pheasantics";"Phoenexus";"Phoenixia";"Piagnome";"Pigloo";"Pignite";"Pillagerman";"Pionearly";"Pitapatriot";"Pixelf";"Pixigh";"Poltergeisha";"Ponylon";"Ponymph";"Porcupid";"Porcupie";"Porcupike";"Porcupint";"Porcupity";"Porcupixel";"Porpoison";"Potatoad";"Preaster";"Prepatriarch";"Priestar";"Priestyle";"Proccultist";"Proctopus";"Pupillager";"Pygmeanie";"Pyrobot";"Pyrogre";"Pyrogue";"Quailment";"Rabbite";"Rabbyte";"Rangerman";"Raptortilla";"Raptortoise";"Rascalf";"Rebelf";"Reconjurer";"Recyclops";"RedHerring";"RedPandaisy";"RedPandame";"Rerunner";"Rerunt";"Retrobot";"Retrogue";"Revenano";"Rhignome";"Rhinocerious";"Rhinosaur";"Rivalkyrie";"Robottom";"Roguerrilla";"Roverlord";"Roverseer";"Sailorc";"Sailord";"Sailore";"Sailoreal";"Saladiator";"Salamaniac";"Salamantis";"Salmonkey";"Salmonster";"Samuraider";"Sardiner";"Sasquire";"Sassassin";"Scampirate";"Scarabyte";"Scentaur";"Scorpeon";"Scraptor";"SeaLionness";"Sealectric";"Sealite";"Sealixir";"Sellamander";"Sewarlock";"Irrelephant";"Sha-Doh";"Shadept";"Sharcade";"Sharctic";"Sheeple";"Sincubus";"Sirenforcer";"Sirental";"Sitcommander";"Slayerk";"Slother";"Slotherworld";"Slotherworldly";"SnailMail";"Snailment";"Snakebab";"Sniperipheral";"Sniperks";"Sniperv";"Snowmanta";"Snowmantis";"Sockroach";"Soyster";"Spaladin";"Sparasite";"Sparrowling";"Specterminate";"Spiderby";"Spillager";"Spookworm";"Spreest";"Spright";"Squidiot";"Squidle";"Squidol";"Starfishht";"Starfissure";"Starfist";"Stenchanter";"StingRaymond";"Stingraider";"StingrayCharles";"Stinkbuggy";"Stoutlaw";"Succubusted";"Sukiyaking";"Sultank";"Sultantrum";"Sumogre";"Sundaemon";"Sunraider";"SwallowRider";"Tabooccaneer";"Tabutcher";"Tangoddess";"Techgnome";"Teriyaking";"Termight";"Termime";"Termitis";"Thortoise";"Titank";"Tomatoad";"Totemperor";"Totemplar";"Toucancan";"Toucandy";"Toucane";"Toucannon";"Toucanoe";"Tourtoise";"Trollout";"Troutlaw";"Troutwards";"Tsardine";"Turbandit";"Turbanshee";"Turbogre";"Turkiwi";"Twilightingale";"Typogre";"Unbandit";"Unbanshee";"Uniqueen";"Urchinchilla";"Valord";"Vanillama";"Vertighost";"Victorc";"Videogre";"Vikingkong";"Vikingpin";"Vipersia";"Volcagnome";"Vulturret";"Wahooligan";"Wallaby";"Walruse";"Warachnid";"Warhawk";"Warlocket";"Warthawk";"Waspear";"Weaselfie";"Wenchanter";"Wincubus";"Windighost";"Witchy";"Wizart";"Wolferal";"Wolfire";"Wolveriot";"Wolverival";"Wombait";"Wombattalion";"Wombattle";"Womblast";"Woodpecan";"Woodpecs";"Wrathhawk";"Wrathhog";"Yahooligan";"Yakar";"Yetea";"Zebrag";"Zebrass";"Zebrawl";"ZerobotPixelephant";"Zerobot";"Acrobatic";"Acting";"Action";"Active";"Adorable";"Advice";"Advise";"Afternoon";"Agile";"Air";"Alien";"Amazing";"Amused";"Amusing";"Ancient";"Angel";"Angelic";"Anger";"Angry";"Antique";"Aqua";"Arch";"Arctic";"Artistic";"Ash";"Asking";"Attack";"Attractive";"Aunt";"Authority";"Autumn";"Awesome";"Awful";"Awkward";"Baby";"Bad";"Baking";"Balance";"Balloon";"Bath";"Battle";"Beautiful";"Bed";"Big";"BigBad";"Bitter";"Black";"Blade";"Bland";"Blind";"Blood";"Blue";"Blushing";"Bold";"Bony";"Bouncing";"Bouncy";"Box";"Brave";"Breakfast";"Bright";"Broken";"Bronze";"Brother";"Brown";"Bruised";"Brutish";"Bubble";"Bubbly";"Calm";"Candid";"Candy";"Cannon";"Careful";"Careless";"Caring";"Chain";"Change";"Charge";"Charming";"Cheap";"Cheat";"Cheating";"Cheerful";"Cheery";"Chief";"Chill";"Chilly";"Classic";"Clean";"Clever";"Club";"Clueless";"Clumsy";"Coach";"Cold";"Color";"Colorful";"Complex";"Computer";"Confused";"Consult";"Control";"Cooking";"Cool";"Copper";"Corny";"Corrupt";"Country";"Covert";"Crafty";"Crash";"Crazy";"Creative";"Creepy";"Criminal";"Crooked";"Crown";"Cruel";"Cuddly";"Curly";"Cute";"Dance";"Dancing";"Dapper";"Dark";"Darling";"Daughter";"Daydream";"Dazzling";"Dead";"Death";"Defiant";"Delirious";"Desert";"Design";"Diet";"Digital";"Dim";"Dinner";"Dirty";"Discrete";"Dizzy";"Doctor";"Doom";"Dopey";"Dream";"Droopy";"Dust";"Eager";"Ecstatic";"Elder";"Electric";"Elegant";"Embarrased";"Emotional";"Enchanted";"Enchanting";"Enormous";"Enraged";"Euphoric";"Evening";"Evil";"Excited";"Exotic";"Expert";"Fabulous";"Fact";"Fake";"FALSE";"Family";"Famous";"Fancy";"Fantastic";"Farm";"Fast";"Fat";"Father";"Fearless";"Feisty";"Fickle";"Fiery";"Filthy";"Fire";"First";"Flamboyant";"Flame";"Flashy";"Flawless";"Flimsy";"Fluffy";"Foolish";"Force";"Forest";"Formal";"Forsaken";"Free";"Fresh";"Friendly";"Frightened";"Frightening";"Frizzy";"Frosty";"Frozen";"Fruit";"Funny";"Fur";"Furry";"Fuzzy";"Game";"Gamer";"Gaming";"Garden";"Gentle";"Ghost";"Giant";"Gifted";"Glamorous";"Glass";"Glittering";"Gloomy";"Glorious";"Golden";"Good";"Gorgeous";"Gothic";"Graceful";"Gracious";"Grand";"Grass";"Grave";"Gray";"Great";"Greedy";"Green";"Grim";"Grizzly";"Ground";"Grumpy";"Gummy";"Hairy";"Hammer";"Handsome";"Happy";"Harmless";"Harsh";"Haunted";"Haunting";"Healthy";"Heart";"Heavy";"Helpful";"Hidden";"Hilarious";"History";"Hollow";"Home";"Honest";"Honor";"Hope";"Horrible";"Huge";"Hugging";"Humble";"Humor";"Hungry";"Icky";"Icy";"Identical";"Idiotic";"Idle";"Illegal";"Imaginary";"Impossible";"Impulse";"Incredible";"Infamous";"Infernal";"Innocent";"Insecure";"Intelligent";"Iron";"Island";"Jealous";"Jelly";"Joke";"Jolly";"Journey";"Jumbo";"Jungle";"Junior";"Keyboard";"Kind";"Kissy";"Knowledge";"Lake";"Land";"Laser";"Laughing";"Lazy";"Light";"Lightning";"Liquid";"Little";"Lone";"Lonely";"Lost";"Loud";"Lovable";"Love";"Loyal";"Lucky";"Lunch";"Mad";"Magic";"Magical";"Magma";"Majestic";"Marble";"Marsh";"Masked";"Mean";"Mega";"Mellow";"Memory";"Merry";"Messy";"Midnight";"Mild";"Mimic";"Mini";"Money";"Morning";"Mother";"Mountain";"Mud";"Mushy";"Music";"Musical";"Mysterious";"Mystery";"Naive";"Naughty";"Needy";"Nervous";"Night";"Nightmare";"Nimble";"Nutty";"Obvious";"Ocean";"Odd";"Old";"Opinion";"Orange";"Ordinary";"Original";"Pale";"Paper";"Parallel";"Party";"Peace";"Peaceful";"Perfect";"Perfumed";"Perky";"Pesky";"Phantom";"Phony";"Pink";"Plastic";"Play";"Playful";"Plush";"Poison";"Polite";"Poor";"Posh";"Positive";"Pretty";"Prime";"Prison";"Proud";"Puny";"Pure";"Quick";"Quiet";"Quirky";"Radioactive";"Rain";"Rapid";"Rare";"Reckless";"Record";"Recording";"Red";"Respect";"Rhythm";"Rich";"Riddle";"River";"Road";"Rock";"Room";"Rotten";"Royal";"Rude";"Rusty";"Sad";"Sand";"Scared";"Scary";"Scented";"School";"Science";"Sea";"Secret";"Selfish";"Serene";"Shadow";"Shady";"Shallow";"Shiny";"Short";"Show";"Shy";"Silent";"Silk";"Silly";"Silver";"Simple";"Sister";"Sleep";"Sleeping";"Sleepy";"Slow";"Small";"Smart";"Smiling";"Smooth";"Smug";"Sneaky";"Snow";"Soft";"Son";"Song";"Sour";"Spooky";"Spotless";"Spotted";"Spring";"Stark";"Steam";"Steel";"Storm";"Strange";"Strong";"Stylish";"Subtle";"Sugar";"Summer";"Surprise";"Swamp";"Swift";"Tall";"Terrific";"Throne";"Thunder";"Time";"Tiny";"Tired";"Trained";"Travel";"Troubled";"Trusty";"Twin";"Ugly";"Uncle";"Unique";"Unusual";"Upset";"Vague";"Vain";"Venom";"Vicious";"Violent";"Violet";"Virtual";"Volcano";"Voyage";"War";"Water";"Wax";"Weird";"White";"Wiggly";"Wild";"Wind";"Winter";"Wise";"Witty";"Worthy";"Writer";"Writing";"Wrong";"Yellow";"Young";"Albatross";"Alligator";"Almond";"Alpaca";"Android";"Ant";"Antelope";"Ape";"Apple";"Apricot";"Armadillo";"Arrow";"Assassin";"Avocado";"Baboon";"Badger";"Ball";"Banana";"Bandit";"Banshee";"Barracuda";"Bat";"Bear";"Beaver";"Bee";"Beetle";"Berry";"Birdie";"Bison";"Blackberry";"Blizzard";"BloodElf";"Blossom";"Blueberry";"Boar";"Boomer";"Bot";"Boulder";"Boy";"Bronco";"Brownie";"Bruiser";"Buffalo";"Bug";"Bull";"Bullet";"Bullfrog";"Buster";"Butterfly";"Cake";"Calf";"Camel";"Captain";"Caribou";"Cat";"Caterpillar";"Centaur";"Champ";"Champion";"Charger";"Cheetah";"Cherry";"Chick";"Chicken";"Chimera";"Chimp";"Chimpanzee";"Chomper";"Clam";"Cobra";"Coconut";"Cod";"Coffee";"Colonel";"Colt";"Conqueror";"Cookie";"Cow";"Coyote";"Cranberry";"Crane";"Crocodile";"Crow";"Cruncher";"Crusader";"Cub";"Custard";"Cyborg";"Cyclops";"Daemon";"Deer";"Defender";"Demon";"Dessert";"Devil";"Dino";"Dinosaur";"Diva";"Dog";"Doggy";"Dolphin";"Donkey";"Dots";"Doughnut";"Dove";"Dragon";"Dragonfly";"Drake";"Droid";"Drummer";"Duck";"Duckling";"Duke";"Dunker";"Dutchess";"Dwarf";"Eagle";"Eel";"Eland";"Elephant";"Elf";"Emu";"Enigma";"Fairy";"Falcon";"Fawn";"Fay";"Ferret";"Fiend";"Fig";"Figure";"Fish";"Fishy";"Flamingo";"Flash";"Fledgling";"Flower";"Fly";"Foal";"Fortune";"Fowl";"Fox";"Frog";"Frogger";"Froglet";"Fry";"Fury";"Gangster";"General";"Genie";"Gerbil";"Giraffe";"Girl";"Gnoll";"Gnu";"Goat";"Goblin";"God";"Goddess";"Goldfish";"Goliath";"Goose";"Grape";"Grapefruit";"Grasshopper";"Griffin";"Grin";"Guardian";"GuineaPig";"Gull";"Guy";"Halfling";"Hamster";"Hare";"Harpy";"Hatchling";"Haunt";"Hawk";"Hazelnut";"Hero";"Heroine";"Herring";"Hippo";"Hobbit";"Hoglet";"Hooper";"Hopper";"Horse";"Hound";"Hummingbird";"Hunter";"Hurricane";"Hydra";"Hyena";"Ibis";"Idol";"Immortal";"Imp";"Incubus";"Infant";"Jackal";"Jaguar";"Jellyfish";"Judge";"Juniper";"Juvenile";"Kangaroo";"Khajiit";"King";"Kingfisher";"Kit";"Kitten";"Kitty";"Kiwi";"Knight";"Koala";"KomodoDragon";"Kraken";"Lady";"Lamb";"Lark";"Larva";"Leaf";"Leech";"Lemon";"Lemur";"Leopard";"Leprechaun";"Lice";"Lime";"Lion";"Lizard";"Llama";"Lobster";"Locust";"Lord";"Lynx";"Macaw";"Machine";"Mage";"Maggot";"Magician";"Magpie";"Maiden";"Mallard";"Mammoth";"Manatee";"Mandarin";"Mango";"Mantis";"Maple";"Maverick";"Meerkat";"Melon";"Mermaid";"Merman";"Minotaur";"Mite";"Mobster";"Mole";"Mongoose";"Monk";"Monkey";"Monster";"Moose";"Mosquito";"Mouse";"Mule";"Muppet";"Mutant";"Necromancer";"Nestling";"Newt";"NightElf";"Nightingale";"Nova";"Nugget";"Nut";"Nymph";"Oak";"Ocelot";"Octopus";"Ogre";"Okapi";"Olive";"Oracle";"Orangutan";"Orc";"Ostrich";"Otter";"Owl";"Owlet";"Ox";"Oyster";"Paladin";"Palm";"Panda";"Panther";"Papaya";"Parrot";"Patriot";"Pattern";"Peafowl";"Peanut";"Pear";"Pecan";"Pegasus";"Pelican";"Penguin";"Pepper";"Petal";"Phantasm";"Pheasant";"Phoenix";"Pie";"Pig";"Pigeon";"Piggy";"Piglet";"Pineapple";"Pirate";"Pixie";"Plum";"Pony";"Porcupine";"Porpoise";"Potato";"Predator";"Priest";"Priestess";"Prince";"Princess";"Prophet";"Prowler";"Pug";"Puggle";"Pumpkin";"Pup";"Puppy";"Pygmy";"Python";"Quail";"Queen";"Rabbit";"Raccoon";"Raider";"Ram";"Ranger";"Raptor";"Rascal";"Raspberry";"Rat";"RedPanda";"Reindeer";"Revenant";"Rhino";"Rhinoceros";"Roach";"Robot";"Rogue";"Rose";"Rover";"Runner";"Sage";"Sailor";"Saint";"Salamander";"Salmon";"Sardine";"Satyr";"Scorpion";"SeaLion";"SeaUrchin";"Seahorse";"Seal";"Seer";"Serpent";"Shade";"Shark";"Sheep";"Shifter";"Siren";"Skeleton";"Skunk";"Slider";"Slingshot";"Sloth";"Smile";"Smirk";"Snail";"Snake";"Snowman";"Soldier";"Soul";"Sparkle";"Sparks";"Sparrow";"Specter";"Sphinx";"Spider";"Spike";"Spirit";"Spook";"Sprite";"Squab";"Squid";"Squire";"Squirrel";"Stalker";"Starfish";"Stingray";"Stinkbug";"Stitches";"Stomper";"Stork";"Strawbery";"Stripes";"Succubus";"Sunflower";"Swallow";"Swan";"T-Rex";"Tadpole";"Tauren";"Tea";"Techy";"Termite";"Terror";"Thief";"Tiger";"Titan";"Toad";"Toffee";"Tomato";"Tortoise";"Toucan";"Troll";"Trooper";"Trout";"Tucan";"Tulip";"Tumbler";"Turkey";"Turtle";"Twinkle";"Twinkles";"Unicorn";"Urchin";"Valkyrie";"Vampire";"Vanilla";"Viking";"Villain";"Viper";"Void";"Vulture";"Walker";"Walrus";"Warhog";"Warlock";"Warrior";"Warthog";"Wasp";"Watermelon";"Weasel";"Werewolf";"Whale";"Whelp";"Willow";"Witch";"Wizard";"Wolf";"Wolverine";"Wombat";"Woodpecker";"Worm";"Wraith";"Wrecker";"Yak";"Yeti";"Yew";"Zebra";"Zombie"}},
"select Col2 order by Col1 limit 10", 0))
Thanks to Rory who pointed out that I was doing things the hard way!
The solution is to track down the original file containing the source array.
Open developer tools and go to the Source tab.
Go to (site URL) > Scripts > .js file
Copy to .txt file, remove extraneous JavaScript.
Import to Google Sheets.
Thanks again!
I was trying to import a table from hket website to run some analysis of my own.
When I used: =importxml("http://www1.hket.com/finance/chart/industry-index.do","//*[#id='eti-finance-chart-table']") which represents the link to the site, I am getting the "N/A" error.
The importxml works fine with gurufocus site.
Can you help me out? I haven't been able to figure out what the issue could be.
from what I understand, hket doesn't use HTML or XML format for their table. If that is the case, is there a script I can use in Google Sheets that will let me extract data from hket?
you can see the culprit if you run this formula:
=IMPORTXML("http://www1.hket.com/finance/chart/industry-index.do", "//*")
I'm trying to save data to a Parse database from a Google Apps Script function. I attempted to use the ParseDB library (https://script.google.com/macros/library/d/MxhsVzdWH6ZQMWWeAA9tObPxhMjh3Sh48/12), but I can't seem to get it working. It seems like I'm not accessing the ParseDBInstance correctly:
function onFormSubmit(e) {
// e.namedValues is an object containing question fields associated with lists of responses
var db = getMyDb('redacted',
'redacted',
'response');
Logger.log(db);
db.save({
test: 'a_string'
});
}
I can't find anything online indicating how I'm supposed to be doing this...and I feel like I'm just doing something dumb (pretty new to apps script/javascript in general/parse).
Any suggestions would be much appreciated!
You need to click 'resources > libraries" then use the key "MxhsVzdWH6ZQMWWeAA9tObPxhMjh3Sh48"
You can then use the library by calling ParseDb.getMyDb(applicationId, restApiKey, class)
My application generates a table of data and creates a new spreadsheet document in a user's Google Drive. How can I add formatting (color, font-weight, width, etc.) to individual cells? I can't seem to find any documentation, much less how I could implement this through the google-api-ruby-client.
Most of my findings date back to Google API mailing lists that state it isn't supported.
However, I found that another application accomplishes my desired result. An example of "Smartsheet" exporting a document to Google Drive:
From Smartsheet.com:
And the resulting sheet in my Google Drive:
(Feb 2017) As of Google I/O 2016, developers no longer need to export to Excel nor create a new Sheet w/the desired formatting, so the other answers are now dated. You can now format cells using the Google Sheets API. Here's a short Python example that bolds the 1st row (assuming the file ID is SHEET_ID and SHEETS is the API service endpoint):
DATA = {'requests': [
{'repeatCell': {
'range': {'endRowIndex': 1},
'cell': {'userEnteredFormat': {'textFormat': {'bold': True}}},
'fields': 'userEnteredFormat.textFormat.bold',
}}
]}
SHEETS.spreadsheets().batchUpdate(
spreadsheetId=SHEET_ID, body=DATA).execute()
I also made a developer video on this subject if that helps (see below). BTW, you can do the same in Ruby (see its API quickstart sample) or any other language supported by the Google APIs Client Libraries.
The Sheets API provides features not available in older releases, namely giving developers programmatic access to a Sheet as if you were using the user interface (frozen rows, cell formatting[!], resizing rows/columns, adding pivot tables, creating charts, etc.). If you're new to the API, I've created a few videos with somewhat more "real-world" examples:
Migrating SQL data to a Sheet plus code deep dive post
Formatting text using the Sheets API plus code deep dive post
Generating slides from spreadsheet data plus code deep dive post
To see what else you can do with Google Sheets via its REST API or Google Apps Script, check out my other videos. As you can tell, the Sheets API is primarily for document-oriented functionality as described above, but to perform file-level access such as import/export, copy, move, rename, etc., use the Google Drive API instead.
Smartsheet utilizes the ability of the Google API to import an Excel file. The code is roughly along these lines:
DocsService client = new DocsService(<YOUR APP NAME>);
client.setOAuthCredentials(<OAUTH PARAMETERS>);
DocumentListEntry newEntry = new SpreadsheetEntry();
newEntry.setMediaSource(new MediaByteArraySource(<EXCEL FILE BYTE ARRAY OUTPUT STREAM>, DocumentListEntry.MediaType.XLS.getMimeType()));
newEntry.setTitle(new PlainTextConstruct(<FILE NAME>));
DocumentListEntry insertedEntry = client.insert(new URL("https://docs.google.com/feeds/default/private/full/"), newEntry);
// This is your URL to the new doc
String docUrl = insertedEntry.getDocumentLink().getHref();
We already had the ability to export a Smartsheet to an Excel file with formatting via Apache POI. Adding export to a Google Spreadsheet was quite simple for us to implement and it provided some additional functionality beyond what you could do via the API.
Sorry for the delayed response - just happened across this question.
The APIs only provide access to the data and do not expose any methods to add formatting.
Another option (and the one that ended up using) is to manually create a Google Sheet file, with all of the formatting pre-configured, as a template. Then, instead of creating a new spreadsheet document in the user's Google Drive, copy the template, like so:
var config = require('./config');
var google = require('googleapis');
function createSheetFromTemplate(user, templateFileId, done) {
var oauth2Client = new google.auth.OAuth2(config.google.clientId, config.google.clientSecret);
oauth2Client.setCredentials({
access_token: user.google.token,
refresh_token: user.google.refreshToken,
});
var drive = google.drive({
version: 'v2',
auth: oauth2Client
});
drive.files.copy({
fileId: templateFileId,
resource: {
title: 'New Google Sheet',
parents: [{
id: 'root'
}]
}
}, function(err, response) {
if (err) done(err)
initializeSpreadsheet(response.id, user, done);
});
}
In that code, templateFileId is the file id of your shared template. You can get this fileId from your shared template file in any number of ways, but the quick-and-dirty way is just to copy-and-paste it out of the URL when you share it.
For instance, if the sharing URL is:
https://docs.google.com/spreadsheets/d/1234567890abcdefghijklmnop/edit?usp=sharing
Then the file id is 1234567890abcdefghijklmnop
In my case there is nothing private in the template itself, so I just shared it with 'anyone with the link' configured for 'can view', as described here:
https://support.google.com/drive/answer/2494886
If you need to keep the contents of the template file private, then you'll need to find some way to ensure that the account specified by config.google.clientId has access to it.
Hope that helps!
If, like me, uploading a pre-formatted Excel sheet isn't sufficient, then Google Apps Script looks like it might be the way to go. The Range class specifically lets you manipulate at least some of the formatting you were asking about.
https://developers.google.com/apps-script/reference/spreadsheet/range
setFontColor() and setFontWeight() are there, but I don't know of anything for cell width yet.
Importantly, I have also not yet figured out how to bind a Google Apps Script to the sheet that I'm creating using the Google Drive API SDK (Node/Javascript in my case, Ruby in yours).
https://developers.google.com/apps-script/guides/bound
It's been a while since your question, so I'm betting you've already solved it some other way. I'm also not necessarily suggesting porting everything in your app over to Google Apps Script (although I'm seriously considering it myself...), but if you or some other reader figures out how to bind a Google App Script to a spreadsheet with the google-api-ruby-client, you might be good-to-go.
We are using highcharts as our charting library. It's great and exporting works well in all scenarios except one. We have a donut chart with two levels. When it is rendered in the browser it shows up fine:
If you now export this chart using the default highcharts service it shows a bit like this:
Anyone know why this is happening and if there is any way we can fix this?
I would recommend creating a fiddle of your problem, and emailing HighCharts support about it (or link the fiddle here), they are very helpful and usually respond quickly.
Your problem does however seem to be related to your code as I also generate and export donut charts with no problems
My mistake in the configuration was when I was dynamically updating the colour:
chart.series[0].data[s].update({color: "#FFFFFF")}, false);
This didn't just mean I was updating the color but also the whole point. This meant that by running the above I was running y to nothing! Although the chart displayed ok the data sent to the exporting service was with unset values for the slices.. hence the empty slices in the chart. to fix it I had to do something like:
chart.series[0].data[s].update({
color: "#FFFFFF",
y: chart.series[0].data[s].y,
name: chart.series[0].data[s].name,
)}, false);