How do I use importXML/importHTML to retrieve a stock options chain that is hidden? - google-sheets

I am trying to use importXML or importHTML function to retrieve a stock options chain, specifically using this function to get a table. So far, this is what I have:
=importhtml("https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA","table",3)
The problem I'm getting is that I can't retrieve "hidden" tables. For example, if you go on the website: https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA
If you scroll down on this page the hidden tables would only be revealed if you click on ,"show april 2022", "show may 2022", etc. I am trying to retrieve all of this information.
The end result is that I would like to create a table that looks like this:
https://www.barchart.com/stocks/quotes/tsla/put-call-ratios
And a table that looks like this:
https://www.barchart.com/stocks/quotes/TSLA/options?moneyness=10&view=stacked&expiration=2022-04-14-m
As a result, there are two things that I am trying to create, the above tables shown on barchart.
I have tried to use importHTML or importXML on barchart, but it looks like it's not allowed. If there is a way to directly retrieve the information from barchart, that would be a much better solution rather than having to import all of the data separately using a different website.
Please note, that I do have a beginner knowledge, so a step-by-step solution on what to do would be very helpful. Thank you

Related

ImportXML not returning entire table

I cannot get an entire table to populate with ImportXML. At best I get the first column and I cannot figure this out.
The website I am trying to scrape is: https://classic.warcraftlogs.com/character/us/kromcrush/chills
Do I have any options to retrieve the table rather it be column by column or as a whole?
I have tried all the following plus several others.
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//table[#id='boss-table-1010']/tbody/tr")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tbody/tr")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tbody/tr/td")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr/td")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr/td[1]")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr/td[2]")
Anything outside of column one says Imported content is empty. Please help!
P.S. I have scoured this website and google for answers and every case I find seems to be a syntax error, starting at the table itself doesn't return the entire table which tells me I need a clever method.
It seems that's an issue with the website, because when you click on Inspect you can see the table with id "boss-table-1010" but if you click on View Source that ID is not available, so the table is dynamically rendered and Sheets doesn't find such id.
I've checked it and I can get the data by doing
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills", "//table/tbody//td")
But if you want a more robust solution, it'll be better doing it programmatically by using Python for web scraping

Any way to create custom elements in google docs ie like OLE/OpenDoc or mediawiki?

Is there any way to embed custom parts into a google doc? I know you can do extensions and format the doc certain ways, but what about something more advanced. What I'm looking for is something closer to semantic media wiki, but with all the awesomeness that is google docs.
for instance to have data inline [[Property name::property value]] , but displayed as property value
inline queries like this , which are display/updated as a table
{{#ask:
[[Category:City]]
[[Located in::Germany]]
|?Population
|?Area#km² = Size in km²
}}
I know the first response, why not use ThisWiki or ThatWiki, and the problem is google docs is better (far better) at formatting, printing, etc which is where most people are comfortable, but several folks would like something more expressive and "computable". Also, we want one system.

Google Sheet find cell by URL parameter

I have a database of elements, each element has its own QR Code. After reading the code I would like to be able to open the worksheet on a specific tab and jump to the appropriate cell (according to the element name). Calling a worksheet through a URL with the #gid parameter allows you to open a tab.... the "range" parameter allows you to jump to a specific cell.... and what if I want to search for an item by name? Something like: https://docs.google.com/spreadsheets/d/1fER4x1p.../edit#gid=82420100&search=element_name.... is it possible?
Google has not introduced this yet
But you can look into Google Script (Googles SpreadSheets macros like) to achieve this.
Also a simpler approach will be to just filter the data, but this will change your requirement obviously. For example you can create a Filter with the name you are looking for and then you will get the URL.
This is the URL to a Sample of this, it should open the
Spreadsheet and filter the data when loaded. This is the Icon to
look for to create the filters
here is some documentation for you to get started on Google App Script, but I don't have a direct link to let you know how to catch the parameters for it to process them. What I can tell you is that this is a much more complicated approach than just a URL because it involves programmatic processing on the Spreadsheet side.

Bringing in a google form response to a sheet

Here is a copy of the sheets and form (form > go to live)
https://docs.google.com/a/ncsu.edu/spreadsheets/d/1mEz9mLEgP4Cfts2ZU6NwhNiL6xjWdFbt42RUj-RYbZw/edit?usp=sharing
So currently, I get responses in a different sheet. Ideally, I would get the response on the tracking sheet with the appropriate format for the dates. Additionally, I would like to keep the functionality of the tracking sheet which is to be able add in items by hand and not through the form. I currently have a script in place which auto-inputs the current date as the two separate formats.
So I'm looking for a solution which either takes in form response to the sheet and appropriate cells (the first empty cell). Or I'm looking to create a script which onEdit which when the form sheet is edited, will fetch the new response and copy it over appropriately onto the tacking sheet.
I have tried googling answers.. But I think I may be a failure at it since I wasn't able to really find a solution for this particular problem. Thank you in advance for the help!
form:
https://docs.google.com/forms/d/1AHSQrLkq3U7NJMvgWoH3lAygova7Mi4BaXHdROaaS2g/edit?usp=sharing
The script associated to this form should do the trick.
All the explanations on how to use it are in the response sheet

confused how to use opentables in yql

i am trying to get access to whitepages using YQL. Unfortunately i don't have much experience with opentables.
I was directed to the whitepages xml file at:
http://github.com/spullara/yql-tables/blob/c63212b2ac9db6feb77ae3cecace51ed52e08c01/whitepages/whitepages.search.xml
Does anyone know how to use this table to extract meaningful information using YQL?
Specifically, I'm not sure how to make a query in YQL using this table to search for a person's name.
Help?
Go to the YQL console http://developer.yahoo.com/yql/console/ and click Show Community Tables. That should make the list on the right much bigger, and will include your table.
have you tried to put
&env=http%3A%2F%2Fdatatables.org%2Falltables.env
at the end of your request?

Resources