Do not bring tasks and notifications from Google Calendar - api

-problem
Do not bring tasks and notifications from Google Calendar
enter image description here
I have seven calendars
enter image description here
But the code brings five
Do not bring tasks and notifications from Google Calendar
I'd like to bring two values
Tasks and Notifications
CalendarListEntry.getSummary() needs to get the full title of the calendar entry, but not the tasks and notifications
I brought everything elseㅜㅜ
Please help me
-Describe what I tried
Read the official website of Google Calendar API
Use the calendarListEntry.get method to view and comment on the official website
Googling
-Attempted codes
Log.d(getCalID, "calendarListEntry.getSummary()111 : " + calendarListEntry.getSummary());
Log.d(getCalID, "getId : " + calendarListEntry.getId());
Log.d(getCalID, "getEtag : " + calendarListEntry.getEtag());
calendarListEntry.getAccessRole()
calendarListEntry.getDescription()
calendarListEntry.getColorId()
calendarListEntry.getForegroundColor()
calendarListEntry.getKind()
calendarListEntry.getLocation()
calendarListEntry.getPrimary()
calendarListEntry.getHidden()
calendarListEntry.getSummaryOverride()
calendarListEntry.getDefaultReminders()
for (CalendarListEntry calendarListEntry : items) {
Log.d(getCalID, "calendarListEntry.getSummary()111 : " + calendarListEntry.getSummary());
}
enter image description here
It's different when you bring it

Related

C# stumped with screen scraping issue on aspx page

I'm having some trouble scraping some HTML that I'm getting from a postback on a site. It is an aspx page that I am trying to get the generated HTML from.
I have looked at the cookie data and session data and forum data being sent with Chrome developer tools and I still cannot get the page to respond with the search results despite mimicking almost all of it in my code.
There are 3 dropdowns on the page, 2 of which are pre-populated when you first visit the page. After choosing values for the first 2 (it does a postback every time you select on those two), it will populate values for the 3rd drop down. Once selecting a value in the 3rd drop down, you hit the search button and the results come back in a table below that.
After hitting the search button and getting the results on the screen, I went into developer tools and grabbed all of the values that looked relevant (especially all form values) and captured them in my code, but still no luck. Even captured the big viewstate exactly.
Here is a code sample of many code samples that I've tried. Admittedly, I'm not very familiar with some of these classes and I've been trying different code snippets.
I'm not sure if I'm doing it wrong in my code or if I'm just missing form data or cookies to make it execute the POST and return the correct data. My code currently returns HTML from the page back to the responseInString variable, but the HTML looks like it's the first version of the page (as if you visited it for the first time) with no drop down boxes selected and the 3rd is not populated with any values. So I don't know if my code is actually hitting the code-behind and doing the form POST to make it return data.
Any help would be greatly appreciated. Thank you!
using (var wb = new WebClient())
{
var data = new NameValueCollection();
data["_EVENTTARGET"] = "";
data["_EVENTARGUMENT"] = "";
data["_LASTFOCUS"] = "";
data["_VIEWSTATE"] = "(giant viewstate)";
data["__VIEWSTATEGENERATOR"] = "D86C5D2F";
//3 more form input/select fields after this with values corresponding to the drop downs.
wb.Headers.Add(HttpRequestHeader.Cookie,
".ASPXANONYMOUS=(long string);" +
"ASP.NET_SessionId=(Redacted);" +
" _gid=GA1.2.1071490528.1676265043;" +
"LoginToken=(Redacted);" +
"LoginUserID=(Redacted);" +
"_ga=GA1.1.1195633641.1675746985;" +
"_ga_38VTY8CNGZ=GS1.1.1676265043.7.1.1676265065.0.0.0");
wb.Headers.Add("Sec-Fetch-Dest", "document");
wb.Headers.Add("Sec-Fetch-Mode", "navigate");
wb.Headers.Add("Sec-Fetch-Site", "same-origin");
wb.Headers.Add("Sec-Fetch-User", "?1");
wb.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
var response = wb.UploadValues("(the web page url)", "POST", data);
string responseInString = Encoding.UTF8.GetString(response);
return responseInString;
}

Extracting information from same page popup in python Selenium webscraping

Note : I'm experienced in python however just starting out in selenium and webscraping. Please excuse if this is a bad question or if my fundamentals in selenium seem amiss. I could not find an answer in hours of searching hence i ask here
Goal: To extract the "About the Business" information found in Yelp pages of businesses
Some pages have their about the business information within a Read More button based popup (eg : https://www.yelp.com/biz/and-pizza-bethesda-bethesda)
Some pages do not have their business information in a Read More button based popup (eg : https://www.yelp.com/biz/pneuma-fashions-upper-marlboro-3 )
Problem: Unable to navigate to the About the Business popup that appears after clicking the Read More button and extract the text present in it.
Attempts as of now: From googling I had found explanations on how to handle alert popups or window popups. However the code doesnt work. The popup that emerges when clicking Read More button does not cause change in window_handles
import re
# getting all sections of the page
result=driver.find_elements_by_tag_name("section")
About = None
for sec in result:
if sec.text.startswith("About the Business"):
# this pertains only to the About the business section
main_page=driver.current_window_handle
print(main_page) # Returns the current handle
sec.find_element_by_tag_name("button").click()
popup=None
for handle in driver.window_handles: # is an iterable with only one handle
# The only handle present is the main_page handle
print(handle)
if handle!=main_page:
popup = handle
print(popup) # returns None
driver.switch_to.window(popup) # Throws error because popup=None
# THE FOLLOWING SECTION IS NOT EXECUTED BECAUSE OF THE ERROR ABOVE
#////////////////////////////////////////////////////
button_contents=driver.find_elements_by_tag_name("p")
for b in button_contents:
print(b.text) # intended to print text contents
close=driver.find_element_by_tag_name("button")
close.click()
driver.switch_to.window(main_page)
Please help
Thank you to everyone who reads this question and provides advice and answers
That is a custom pop-up so you won't need to switch to it. I suggest to study about getting relative xpath . Use loop to navigate to your urls and include below code
driver.get(your_URL)
readMoreBtnXpath= "//h4[text()='About the Business']/ancestor::section//button"
aboutTheBusinessSec = "//h4[text()='About the Business']/ancestor::section"
fromTheBusinessSec = "((//h2[text()='From the business']/parent::div/following-sibling::div//div)[5]/div)[last()]/preceding-sibling::div"
try:
driver.find_element(By.XPATH, readMoreBtnXpath).click()
button_contents = driver.find_elements(By.XPATH, fromTheBusinessSec)
for b in button_contents:
print(b.text)
except:
print(driver.find_element(By.XPATH, aboutTheBusinessSec).text)
One thing that u should know is that the pop-up is not displayed in a new window. It is instead displayed in the same page itself. Here is the complete code to extract the text from the pop-up:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.yelp.com/biz/and-pizza-bethesda-bethesda')
try:
driver.find_element_by_xpath('//*[#id="wrap"]/div[3]/div/div[4]/div/div/div[2]/div/div/div[1]/div/div[1]/section[5]/div[2]/button').click()
p1 = driver.find_element_by_xpath('//*[#id="modal-portal-container"]/div[2]/div/div/div/div[2]/div/div[2]/div/div[2]/div/div/div[1]/p').text
p2 = driver.find_element_by_xpath('//*[#id="modal-portal-container"]/div[2]/div/div/div/div[2]/div/div[2]/div/div[2]/div/div/div[2]/p[2]').text
print("Specialties --",p1)
print("History --",p2)
except:
print('Read more button not found')
Output:
Specialties -- Award-winning pizza: Named one of Fast Company's "World's Most Innovative Companies" in 2018, third-place in the Washington Post Express's of "Best Fast Casual" in 2018, third place in the Washington City Paper's "Best Gluten-Free Menu" in 2018 and won its "Best Pizza in D.C." in 2017, 11th on TripAdvisor's "Best Fast Casual Restaurants -- United States" in 2018.
History -- Since 2012, we've built pizza shops with an edge to their craft pies, beverages and shop design, created an environment where ALL of our Tribe can thrive, supported our local communities and now we'll text you back, if you want. Started with a pizza shop. Became a culture. That's &pizza.
Edit:
Since this doesn't work with this website, replace the first find_element_by_xpath with:
driver.find_element_by_xpath("//div[#class='lemon--div__373c0__1mboc border-color--default__373c0__3-ifU']/button[.='Read more']").click()
This works for both the websites.

Katalon Studio - Asking for user input to select link

I am currently automating testing for a ticketing system application in Katalon Studio.
The problem is: when a new ticket has been created (the test automates this beforehand), a ticket name is automatically assigned to it (e.g. 'PML-0121') and this is shown at the top of a table. What I want the code below to do is to ask the user to input the ticket name, then the test will find the link with the corresponding name and navigate to the link.
Could anyone tell me what other operators I need to be using, or if there is even possible code for this issue?
Here is the script:
'Click on ticket link'
JFrame frame = new JFrame('User Input Frame')
frame.requestFocus()
String userInput = JOptionPane.showInputDialog(frame, 'Enter ticket name:')
'Select userInput option'
WebUI.click(findTestObject(String userInput))
'Reach Out button'
WebUI.click(findTestObject('Tickets - Tickets (new)/a_PML-0118 - Emai/a_Reach Out'))
If the new ticket name is always on top of the table, could you get it automatically instead of asking the tester input the value?

FullCalendar Scheduler eventMouseover for Resources

My resource list is a list of users for my scheduler. I would like to show a tooltip when hovering over them that displays user specific information. I can do this easily for events with the eventMouseover but can someone help me do this for resources?
I have all of the user info I just do not know how to make the tooltip appear.
I solved this using the resourceRender function http://fullcalendar.io/docs/resource_rendering/resourceRender/
function resourceRenderCallback(resourceObj, labelTds, bodyTds){
var title = 'Name: ' + resourceObj.title;
labelTds.attr('title', title);
}
From here you can add whatever you desire to title. Another possibility is
labelTds.on('hover', function(){console.log('hover');});
which would allow any jquery event to be triggered for the resource

How to add new non-standard field to event object in Full Calendar

How do you add a non-standard event field to Full Calendar?
I already read the other questions about this - their answers just say the same thing as the documentation which is incomplete
(Simple concept) - One way to do it, if you already have a field created in the database, is to just place that field in the array from your rails page. On the JS side, use eventRender and append it to whatever element you desire.
I just read this in other question, but i didn't test.
add this callback
eventRender: function( event, element, view )
{
//redo the title to include the description
element.find(".fc-event-title").html(event.title + ": <span>" + event.description + "</span>");
},
jQuery Calendar : how to add clickable events on particular dates?